Romain Behar wrote:
Many thanks!

Both
  self.window.connect('delete-event', gtk.main_quit)
 and
  self.window.connect('destroy', gtk.main_quit)
work.

BTW, the difference is that the delete-event is emitted when the window close button is clicked and destroy is emitted when the internal window object is destroyed. The difference is important when you want to display a 'are you sure you want to close?' dialog box when the close button is clicked.

Now, the script quits, but running it again outputs
the following error:

Traceback (most recent call last):
  File "<string>", line 7, in ?
  File
"/usr/lib/python2.3/site-packages/gtk-2.0/gtk/__init__.py",
line 38, in ?
    import gdk # this is created by the _gtk import
ImportError: No module named gdk

Are you unloading modules after the script runs? Extension modules (.pyd's on win32, .so's on most other systems) are often not designed to be unloaded. The same goes for normal python modules in many cases.

John
_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to