2019-03-15 14:03:43 +00:00
|
|
|
import PySimpleGUIWeb as sg
|
|
|
|
|
2019-10-30 18:35:01 +00:00
|
|
|
# Basic example of PSGWeb
|
|
|
|
|
2019-03-15 14:03:43 +00:00
|
|
|
def main():
|
|
|
|
layout = [
|
2019-10-30 18:35:01 +00:00
|
|
|
[sg.Text('This is a text element')],
|
|
|
|
[sg.Input()],
|
|
|
|
[sg.Combo(['Combo 1'])],
|
|
|
|
[sg.Text('If you close the browser tab, the app will exit gracefully')],
|
|
|
|
[sg.InputText('Source')],
|
|
|
|
[sg.InputText('Dest')],
|
|
|
|
[sg.Ok(), sg.Cancel()]
|
|
|
|
]
|
2019-03-15 14:03:43 +00:00
|
|
|
|
2019-10-30 18:35:01 +00:00
|
|
|
window = sg.Window('Demo window..', layout)
|
2019-03-15 14:03:43 +00:00
|
|
|
i = 0
|
|
|
|
while True:
|
2019-10-30 18:35:01 +00:00
|
|
|
event, values = window.read(timeout=1)
|
2019-03-15 14:03:43 +00:00
|
|
|
if event != sg.TIMEOUT_KEY:
|
|
|
|
print(event, values)
|
|
|
|
if event is None:
|
|
|
|
break
|
|
|
|
i += 1
|
2019-10-30 18:35:01 +00:00
|
|
|
window.close()
|
2019-03-15 14:03:43 +00:00
|
|
|
|
|
|
|
main()
|
2019-10-30 18:35:01 +00:00
|
|
|
print('Program terminating normally')
|