demo_editor.py
changeset 41 37b7dfc3eae6
parent 34 e3beacd5e536
child 45 43b2279b06e1
--- a/demo_editor.py	Wed Dec 26 01:00:31 2012 +0100
+++ b/demo_editor.py	Sat Dec 29 12:16:06 2012 +0100
@@ -17,7 +17,7 @@
 class MyApplication(Application):
     def __init__(self):
         Application.__init__(self)
-        self.top.connect('keypress', self.on_keypress)
+        self.top.connect('keypress', self.on_top_keypress)
 
         #edit = EditField(50, 'DlouhyTest12')
         #self.top.add(edit)
@@ -48,13 +48,9 @@
         self.button.label = 'YES'
 
 
-    def on_keypress(self, keyname, char):
-        if keyname == 'escape':
+    def on_top_keypress(self, ev):
+        if ev.keyname == 'escape':
             self.terminate()
-        if keyname == 'f1':
-            self.textedit.settext('%s' % self.top.focuschild)
-            self.textedit.redraw()
-            
 
 
 if __name__ == '__main__':