-
Notifications
You must be signed in to change notification settings - Fork 0
/
pygameTest.py
38 lines (30 loc) · 1014 Bytes
/
pygameTest.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
from pgu import gui
def loadFrame():
def open_file_browser(arg):
d = gui.FileDialog('Load NoteMap file', path='records')
d.connect(gui.CHANGE, handle_file_browser_closed, d)
d.open()
def handle_file_browser_closed(dlg):
if dlg.value:
input_file.value = dlg.value
app.quit()
app = gui.Desktop()
# app.connect(gui.QUIT, app.quit, None)
main = gui.Container(width=500, height=400) # , background=(220, 220, 220) )
# main.add(gui.Label("File Dialog Example", cls="h1"), 20, 20)
td_style = {'padding_right': 10}
t = gui.Table()
t.tr()
t.td(gui.Label('File Name:'), style=td_style)
input_file = gui.Input()
t.td(input_file, style=td_style)
b = gui.Button("Browse...")
t.td(b, style=td_style)
b.connect(gui.CLICK, open_file_browser, None)
main.add(t, 20, 100)
app.run(main)
# app.quit()
# print(input_file.value)
return input_file.value
if __name__ == '__main__':
loadFrame()