[pygtk] Can't run PyGTK more than once from embedded Python

Gian Mario Tagliaretti g.tagliaretti at gmail.com
Sun Jan 8 05:21:09 WST 2006


2006/1/7, Romain Behar <romainbehar a yahoo.com>:

> import pygtk
> pygtk.require('2.0')
> import gtk
>
> class Base:
>         def __init__(self):
>                 self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
>                 self.window.show()
>
>         def main(self):
>                 gtk.main()
>
> print __name__
> if __name__ == "__main__":
>         base = Base()
>         base.main()
>
>
> Is it possible for the above script to quit when the
> window's closed?

do you mean:
self.window.connect("delete-event", gtk.main_quit)

cheers
--
Gian Mario Tagliaretti
PyGTK GUI programming
http://www.parafernalia.org/pygtk/


More information about the pygtk mailing list