demo_checkbox.py
changeset 41 37b7dfc3eae6
parent 34 e3beacd5e536
child 42 0224ce40792f
--- a/demo_checkbox.py	Wed Dec 26 01:00:31 2012 +0100
+++ b/demo_checkbox.py	Sat Dec 29 12:16:06 2012 +0100
@@ -10,20 +10,20 @@
 class MyApplication(Application):
     def __init__(self):
         Application.__init__(self)
-        self.top.connect('keypress', self.on_keypress)
+        self.top.connect('keypress', self.on_top_keypress)
 
         vert = VerticalLayout(homogeneous=False)
         self.top.layout(vert)
-        
+
         combo = ComboBox(items=['abc', 'xyz'])
         self.top.add(combo)
-        
+
         for i in range(10):
             cbox = Checkbox('checkbox ' + str(i))
             self.top.add(cbox)
-        
-    def on_keypress(self, keyname, char):
-        if keyname == 'escape' or char == 'q':
+
+    def on_top_keypress(self, ev):
+        if ev.keyname == 'escape' or ev.char == 'q':
             self.terminate()