quit GTK when window is closed
This commit is contained in:
parent
b6ae011b38
commit
6c09225b44
@ -4,8 +4,12 @@ import gtk
|
|||||||
class Window:
|
class Window:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
|
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
|
||||||
|
self.window.connect("destroy", self.destroy_event)
|
||||||
self.window.add(gtk.Label('Hello World'))
|
self.window.add(gtk.Label('Hello World'))
|
||||||
self.window.show_all()
|
self.window.show_all()
|
||||||
|
|
||||||
def main(self):
|
def main(self):
|
||||||
gtk.main()
|
gtk.main()
|
||||||
|
|
||||||
|
def destroy_event(self, widget, data=None):
|
||||||
|
gtk.main_quit()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user