quit GTK when window is closed

This commit is contained in:
Josh Holtrop 2011-03-22 13:15:31 -04:00
parent b6ae011b38
commit 6c09225b44

View File

@ -4,8 +4,12 @@ import gtk
class Window:
def __init__(self):
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.window.connect("destroy", self.destroy_event)
self.window.add(gtk.Label('Hello World'))
self.window.show_all()
def main(self):
gtk.main()
def destroy_event(self, widget, data=None):
gtk.main_quit()