demo_menu.py
changeset 45 43b2279b06e1
parent 42 0224ce40792f
child 63 2a0e04091898
--- a/demo_menu.py	Wed Jan 02 11:48:36 2013 +0100
+++ b/demo_menu.py	Fri Jan 04 00:13:59 2013 +0100
@@ -10,7 +10,7 @@
 class MyApplication(Application):
     def __init__(self):
         Application.__init__(self)
-        self.top.connect('keypress', self.on_top_keypress)
+        self.top.add_handler('keypress', self.on_top_keypress)
 
         menubar = MenuBar()
         self.top.add(menubar)
@@ -50,22 +50,10 @@
 
         self.top.layout = VerticalLayout()
 
-
-        #button = Button('click!')
-        #win.add(button)
-        #button.x = 10
-        #button.y = 7
-
-        #button.connect('click', self.buttonclick)
-        #self.button = button
-
-        #subwin = Window(8,8)
-        #win.add(subwin)
-
-
     def on_top_keypress(self, ev):
         if ev.keyname == 'escape':
             self.terminate()
+            return True
 
 
 if __name__ == '__main__':