--- a/demo_input.py Wed Jan 02 11:48:36 2013 +0100
+++ b/demo_input.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)
self.text = ''
textedit = TextEdit(100, 40, self.text)
@@ -18,13 +18,13 @@
textedit.x = 2
self.textedit = textedit
-
def on_top_keypress(self, ev):
if ev.char == 'q':
self.terminate()
self.text += 'keyname: %(keyname)s char: %(char)s\n' % ev
self.textedit.settext(self.text)
self.textedit.scrolltoend()
+ return True
if __name__ == '__main__':