demo_input.py
changeset 62 2f61931520c9
parent 55 1ab0edd5d784
child 73 85a282b5e4fc
equal deleted inserted replaced
61:15088f62c4ac 62:2f61931520c9
    10 class MyApplication(Application):
    10 class MyApplication(Application):
    11     def __init__(self):
    11     def __init__(self):
    12         Application.__init__(self)
    12         Application.__init__(self)
    13 
    13 
    14         self.text = ''
    14         self.text = ''
    15         self.textedit = TextEdit(100, 40, self.text)
    15         self.textedit = TextEdit(self.text)
    16         self.top.add(self.textedit)
    16         self.top.add(self.textedit, halign='fill', valign='fill')
    17         self.textedit.x = 2
       
    18 
    17 
    19         editbox = self.textedit.editbox
    18         editbox = self.textedit.editbox
    20         editbox.add_handler('keypress', self.on_any_input)
    19         editbox.add_handler('keypress', self.on_any_input)
    21         editbox.add_handler('mousedown', self.on_any_input)
    20         editbox.add_handler('mousedown', self.on_any_input)
    22         editbox.add_handler('mouseup', self.on_any_input)
    21         editbox.add_handler('mouseup', self.on_any_input)