diff options
author | Damien Moore <damien.moore@excite.com> | 2010-02-14 10:25:49 +0100 |
---|---|---|
committer | Olivier Tilloy <olivier@tilloy.net> | 2010-02-14 10:25:49 +0100 |
commit | 05d3f6cd613be7162442fa3afb39ea9862158f46 (patch) | |
tree | 961b0c42a2bd724fe292389fa092b8c100b9aee7 /src/pygtk-example.py | |
parent | cf59fcb049c222f20563301a6cf24ebe0ff1eadf (diff) | |
download | pyexiv2-05d3f6cd613be7162442fa3afb39ea9862158f46.tar.gz |
PyGTK example application: connect to the 'destroy' signal to exit when closing the window.
Diffstat (limited to 'src/pygtk-example.py')
-rwxr-xr-x | src/pygtk-example.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/pygtk-example.py b/src/pygtk-example.py index d976a6e..ccd1d94 100755 --- a/src/pygtk-example.py +++ b/src/pygtk-example.py @@ -46,6 +46,7 @@ if __name__ == '__main__': sys.exit(1) app = gtk.Window(gtk.WINDOW_TOPLEVEL) + app.connect('destroy', lambda app: gtk.main_quit()) # Load the image, read the metadata and extract the thumbnail data metadata = ImageMetadata(sys.argv[1]) @@ -68,8 +69,6 @@ if __name__ == '__main__': imgwidget.set_from_pixbuf(pixbuf) # Show the application's main window - # Note: closing the window will not terminate the application as no - # appropriate signal has been defined. app.add(imgwidget) imgwidget.show() app.show() |