Federico Di Gregorio wrote:
sorry if this is a FAQ or has already been discussed here. feel free to
send me to the ML archives. i was using twisted (and the gtk2reactor)
with pygtk 1.99.13 and everything worked fine. after an upgrade to .14
it stopped working and digging into the code i discovered that a
callback added using gtk.input_add does get called only once.
example program (foo will be called when you hit RET, but only once):
import pygtk ; pygtk.require('2.0')
import gtk
def foo(a, b):
print "foo called with args:", a, b
If you want your callback to be requeued, add "return True" to the end.
Returning None (which happens if you have no return statement) is
treated the same as returning False, which tells gtk not to requeue the
callback.
gtk.input_add(0, gtk.gdk.INPUT_READ, foo)
gtk.main()
is this right? did it changed in latest gtk, pygtk or simply i dreamed
when i saw my glade2/gtk2/twisted application working?
James.
--
Email: [EMAIL PROTECTED]
WWW: http://www.daa.com.au/~james/
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/