equal
deleted
inserted
replaced
1 #!/usr/bin/env python3 |
1 #!/usr/bin/env python3 |
2 |
2 |
3 import demobase |
3 import sys |
4 |
4 |
5 from tuikit.core.application import Application |
5 from tuikit.core.application import Application |
6 #from tuikit.scrollview import ScrollView |
6 #from tuikit.scrollview import ScrollView |
7 from tuikit.widgets.textbox import TextBox |
7 from tuikit.widgets.textbox import TextBox |
8 |
8 |
12 def __init__(self): |
12 def __init__(self): |
13 Application.__init__(self) |
13 Application.__init__(self) |
14 self.window_manager.sig_keypress.connect(self.on_wm_keypress) |
14 self.window_manager.sig_keypress.connect(self.on_wm_keypress) |
15 #self.top.add_handler('keypress', self.on_top_keypress) |
15 #self.top.add_handler('keypress', self.on_top_keypress) |
16 |
16 |
17 t = open('../tuikit/core/widget.py').read() |
17 t = open(sys.argv[0]).read() |
18 editbox = TextBox(t) |
18 editbox = TextBox(t) |
19 |
19 |
20 #scroll = ScrollView() |
20 #scroll = ScrollView() |
21 #scroll.add(editbox) |
21 #scroll.add(editbox) |
22 |
22 |
26 def on_wm_keypress(self, ev): |
26 def on_wm_keypress(self, ev): |
27 if ev.keyname == 'escape': |
27 if ev.keyname == 'escape': |
28 self.stop() |
28 self.stop() |
29 return True |
29 return True |
30 |
30 |
31 |
|
32 if __name__ == '__main__': |
31 if __name__ == '__main__': |
33 app = MyApplication() |
32 app = MyApplication() |
34 app.start() |
33 app.start() |
35 |
34 |