--- a/demo_editor.py Wed Jan 02 11:48:36 2013 +0100
+++ b/demo_editor.py Fri Jan 04 00:13:59 2013 +0100
@@ -8,49 +8,27 @@
from tuikit.application import Application
from tuikit.editfield import EditField
-from tuikit.window import Window
-from tuikit.button import Button
-from tuikit.scrollbar import VScrollbar
from tuikit.textedit import TextEdit
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)
#edit = EditField(50, 'DlouhyTest12')
#self.top.add(edit)
-
t = open('tuikit/widget.py').read()
textedit = TextEdit(100, 40, t)
self.top.add(textedit)
textedit.x = 2
self.textedit = textedit
- #win = Window()
- #self.top.add(win)
-
- #button = Button('click!')
- #win.add(button)
- #button.x = 10
- #button.y = 7
-
- #button.connect('click', self.buttonclick)
- #self.button = button
-
- #subwin = Window(8,8)
- #win.add(subwin)
-
-
- def buttonclick(self):
- self.button.label = 'YES'
-
-
def on_top_keypress(self, ev):
if ev.keyname == 'escape':
self.terminate()
+ return True
if __name__ == '__main__':