demo_treeview.py
changeset 42 0224ce40792f
parent 41 37b7dfc3eae6
child 45 43b2279b06e1
equal deleted inserted replaced
41:37b7dfc3eae6 42:0224ce40792f
     2 # -*- coding: utf-8 -*-
     2 # -*- coding: utf-8 -*-
     3 
     3 
     4 import locale
     4 import locale
     5 locale.setlocale(locale.LC_ALL, '')
     5 locale.setlocale(locale.LC_ALL, '')
     6 
     6 
     7 from tuikit import *
     7 from tuikit import Application, TreeView, TreeModel, ScrollView, VerticalLayout
     8 
     8 
     9 
     9 
    10 class MyApplication(Application):
    10 class MyApplication(Application):
    11     def __init__(self):
    11     def __init__(self):
    12         Application.__init__(self)
    12         Application.__init__(self)
    27 
    27 
    28         scroll = ScrollView()
    28         scroll = ScrollView()
    29         scroll.add(view)
    29         scroll.add(view)
    30         self.top.add(scroll, expand=True, fill=True)
    30         self.top.add(scroll, expand=True, fill=True)
    31 
    31 
    32         vert = VerticalLayout()
    32         self.top.layout = VerticalLayout()
    33         self.top.layout(vert)
       
    34 
    33 
    35     def on_top_keypress(self, ev):
    34     def on_top_keypress(self, ev):
    36         if ev.keyname == 'escape':
    35         if ev.keyname == 'escape':
    37             self.terminate()
    36             self.terminate()
    38 
    37