demos/03_application.py
changeset 111 b055add74b18
parent 109 105b1affc3c2
child 114 26c02bd94bd9
equal deleted inserted replaced
110:cf3d49cdd6e2 111:b055add74b18
    23 app.root_window.add(button1)
    23 app.root_window.add(button1)
    24 app.root_window.add(button2)
    24 app.root_window.add(button2)
    25 app.root_window.add(field)
    25 app.root_window.add(field)
    26 app.root_window.focus_widget = field
    26 app.root_window.focus_widget = field
    27 
    27 
    28 def on_keypress(keyname, char, mod):
    28 def on_keypress(ev):
    29     if keyname == 'escape':
    29     if ev.keyname == 'escape':
    30         app.stop()
    30         app.stop()
    31 
    31 
    32 app.window_manager.sig_keypress.connect(on_keypress)
    32 app.window_manager.sig_keypress.connect(on_keypress)
    33 
    33 
    34 app.start()
    34 app.start()