[pygtk] registering signal callback function
lauromoura at gmail.com
Wed Jul 4 17:52:35 WST 2007
On 7/2/07, varun_shrivastava <shrivastavavarun at yahoo.co.in> wrote:
> hi Felix
> i mean to say, i have a class which registers certain signals using
> and i have to use g_signal_connect to register a callback function.
> Now i am generating python bindings for this class, but i m not sure about
> how to register callback functions that will be written in python.
> should i provide a wrapper function which will take python object as
> argument and will
> internally register a dummy signal callback function using g_signal_connect.
> this dummy function will than provide a mechanism to call python code from C
> ie to say
> from python i will call a function as
> defs p:
> this will call wrapper function register_callback which looks like
> static PyObject *
> PyArg_ParseTuple(); //----> conversion from python to C
> and in dummy function i will write the code to call python function "p"
> will this be OK or is there any other method
Maybe you can send the pointer to the python callback as user_data,
wich will be recieved by the C callback, without need of that dummy
Lauro Moura ("lmoura" on Freenode)
More information about the pygtk