demo_menu.py
changeset 41 37b7dfc3eae6
parent 40 5faa38c10b67
child 42 0224ce40792f
--- a/demo_menu.py	Wed Dec 26 01:00:31 2012 +0100
+++ b/demo_menu.py	Sat Dec 29 12:16:06 2012 +0100
@@ -10,7 +10,7 @@
 class MyApplication(Application):
     def __init__(self):
         Application.__init__(self)
-        self.top.connect('keypress', self.globalkeypress)
+        self.top.connect('keypress', self.on_top_keypress)
 
         menubar = MenuBar()
         self.top.add(menubar)
@@ -64,8 +64,8 @@
         #win.add(subwin)
 
 
-    def globalkeypress(self, keyname, char):
-        if keyname == 'escape':
+    def on_top_keypress(self, ev):
+        if ev.keyname == 'escape':
             self.terminate()