--- 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()