[pygtk] registering signal callback function
shrivastavavarun at yahoo.co.in
Tue Jul 3 19:49:54 WST 2007
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
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
> hi Felix
> i want to ask, how can i access g_signal_connect_* family of APIs from
> do i need to write a c code that will act as a callback for signal
> handler, and
> in that c code i will call python functions
> Felix Rabe (public) wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>> Hi Varun,
>> varun_shrivastava wrote:
>>> i m new to pygtk
>>> and want to know how its better to use
>>> pygtk rather than gtk
>>> what r its pros and cons
>> Use GTK+ if your programming language is C
>> - - It is more cumbersome to program
>> + Your application executes faster
>> Use PyGTK if your programming language is Python
>> + It is easier (and more fun :) ) to program
>> - - Your application executes more slowly
>> Start out with the programming language you know. Lern GTK+ if you know
>> C, or PyGTK if you know Python. If you don't know either C or Python,
>> Python is *way* easier to learn than C, but C is also simple enough. I
>> learned both (C / GTK+ first).
>> I personally browse the GTK+ source code (yes, the library's code)
>> sometimes to find out "best practise" / some examples / how stuff works.
>> But normally you do not need to do this if you just program in PyGTK
>> and are not a perfectionist like me. :o)
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.6 (GNU/Linux)
>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>> -----END PGP SIGNATURE-----
>> pygtk mailing list pygtk at daa.com.au
>> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
View this message in context: http://www.nabble.com/Pygtk-or-gtk-tf3913322.html#a11394462
Sent from the Gtk+ - Python mailing list archive at Nabble.com.
More information about the pygtk