2 sys.path.insert(0, '..')
6 from pygame.locals import *
10 def open_file_browser(arg):
12 d.connect(gui.CHANGE, handle_file_browser_closed, d)
16 def handle_file_browser_closed(dlg):
17 if dlg.value: input_file.value = dlg.value
21 #gui.theme.load('../data/themes/default')
23 app.connect(gui.QUIT,app.quit,None)
25 main = gui.Container(width=500, height=400) #, background=(220, 220, 220) )
28 main.add(gui.Label("File Dialog Example", cls="h1"), 20, 20)
31 td_style = {'padding_right': 10}
34 t.td( gui.Label('File Name:') , style=td_style )
35 input_file = gui.Input()
36 t.td( input_file, style=td_style )
37 b = gui.Button("Browse...")
38 t.td( b, style=td_style )
39 b.connect(gui.CLICK, open_file_browser, None)
46 #profile.run('app.run(main)')