demo_tableview.py
changeset 45 43b2279b06e1
parent 42 0224ce40792f
child 64 03f591f5fe5c
equal deleted inserted replaced
44:d77f1ae3786c 45:43b2279b06e1
    10 
    10 
    11 
    11 
    12 class MyApplication(Application):
    12 class MyApplication(Application):
    13     def __init__(self):
    13     def __init__(self):
    14         Application.__init__(self)
    14         Application.__init__(self)
    15         self.top.connect('keypress', self.on_top_keypress)
    15         self.top.add_handler('keypress', self.on_top_keypress)
    16 
    16 
    17         data = []
    17         data = []
    18         for y in range(100):
    18         for y in range(100):
    19             row = [str(y+1)]
    19             row = [str(y+1)]
    20             for x in range(10):
    20             for x in range(10):
    32         self.top.layout = VerticalLayout()
    32         self.top.layout = VerticalLayout()
    33 
    33 
    34     def on_top_keypress(self, ev):
    34     def on_top_keypress(self, ev):
    35         if ev.keyname == 'escape':
    35         if ev.keyname == 'escape':
    36             self.terminate()
    36             self.terminate()
       
    37             return True
    37 
    38 
    38 
    39 
    39 if __name__ == '__main__':
    40 if __name__ == '__main__':
    40     app = MyApplication()
    41     app = MyApplication()
    41     app.start()
    42     app.start()