demos/04_texteditor.py
author Radek Brich <radek.brich@devl.cz>
Sun, 15 Feb 2015 17:50:24 +0100
changeset 116 165b5d65e1cb
parent 115 b4ff7392003a
child 117 8680c2333546
permissions -rwxr-xr-x
Drop AnchorLayout, merge its features into FixedLayout.

#!/usr/bin/env python3

import demobase

from tuikit.core.application import Application
#from tuikit.scrollview import ScrollView
from tuikit.widgets.textbox import TextBox


class MyApplication(Application):

    def __init__(self):
        Application.__init__(self)
        self.window_manager.sig_keypress.connect(self.on_wm_keypress)
        #self.top.add_handler('keypress', self.on_top_keypress)

        t = open('../tuikit/core/widget.py').read()
        editbox = TextBox(t)

        #scroll = ScrollView()
        #scroll.add(editbox)

        self.root_window.add(editbox)
        #self.root_window.add(scroll, halign='fill', valign='fill')

    def on_wm_keypress(self, ev):
        if ev.keyname == 'escape':
            self.stop()
            return True


if __name__ == '__main__':
    app = MyApplication()
    app.start()