egbert wrote:
This obviously suicidal script falls into a
'RunTimeError: called from outside of a mainloop'
caused by gtk.main_quit().
Why ?
#!/usr/bin/env python
import gtk
win = gtk.Window(gtk.WINDOW_TOPLEVEL)
win.show()
gtk.main_quit() # called from outside of a mainloop
gtk.main()
I know, I can make this script run by using
win.connect("destroy", gtk.main_quit)
in stead of the guilty line, but that doesn't help me,
because in my real life script I want to do something like this:
if some_condition:
gtk.main_quit()
If it's going to do this before calling the main loop then why not
reverse the condition and don't call the loop altogether?
If it's going to be done in a event handler than it will be inside the
mainloop.
--
Regards,
Jakub Piotr Cłapa
_______________________________________________
pygtk mailing list [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/