-
Notifications
You must be signed in to change notification settings - Fork 25
/
starter.py
40 lines (26 loc) · 864 Bytes
/
starter.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/python
# -*- coding: utf-8 -*-
"gui2py application example using a resource"
__author__ = "Mariano Reingart (reingart@gmail.com)"
__copyright__ = "Copyright (C) 2013- Mariano Reingart"
__license__ = "LGPL 3.0"
import gui
def on_load(evt):
print "initializing!"
evt.window['mypanel']['mybutton'].label = "Click ME!!!!"
evt.window.show()
def on_menu_file_about_click(event):
pass
def on_menu_file_exit_click(evt):
evt.window.close()
def on_field1_change(evt):
print "Changed, new text: ", evt.window['field1'].value
def on_field1_keypress(evt):
print "Keypress: ", evt.key
if evt.key == 13:
gui.alert(evt.window['field1'].value, "hello world!")
def on_mypanel_mybutton_click(etv):
gui.alert("btn clicked!!!!")
if __name__ == '__main__':
window = gui.load()
gui.main_loop()