Release 0.18.0, Updated Demo Programs
This commit is contained in:
parent
97c717d67c
commit
f7e563c81b
8 changed files with 332 additions and 5 deletions
34
PySimpleGUIWeb/Demo Programs/Web_Popup.py
Normal file
34
PySimpleGUIWeb/Demo Programs/Web_Popup.py
Normal file
|
@ -0,0 +1,34 @@
|
|||
import PySimpleGUIWeb as sg
|
||||
|
||||
"""
|
||||
____
|
||||
| _ \ ___ _ __ _ _ _ __
|
||||
| |_) / _ \| '_ \| | | | '_ \
|
||||
| __/ (_) | |_) | |_| | |_) |
|
||||
|_| \___/| .__/ \__,_| .__/
|
||||
|_| |_|
|
||||
|
||||
A Popup demonstration. A "Popup" window is shown over the main
|
||||
window. Clicking OK will close the Popup and you return to main again.
|
||||
"""
|
||||
|
||||
print('Starting up...')
|
||||
|
||||
layout = [
|
||||
[sg.Text('Your typed chars appear here:'), sg.Text('', key='_OUTPUT_')],
|
||||
[sg.Input(do_not_clear=True, key='_IN_')],
|
||||
[sg.Button('Show'), sg.Button('Exit'), sg.Button('Blank')]
|
||||
]
|
||||
|
||||
window = sg.Window('Window Title').Layout(layout)
|
||||
|
||||
while True: # Event Loop
|
||||
print('in event loop')
|
||||
event, values = window.Read()
|
||||
print(event, values)
|
||||
if event is None or event == 'Exit':
|
||||
break
|
||||
if event == 'Show':
|
||||
sg.Popup('A popup!', ' You typed ', values['_IN_'])
|
||||
|
||||
window.Close()
|
Loading…
Add table
Add a link
Reference in a new issue