|
1 | 1 | #!/usr/bin/env python |
2 | 2 | import PySimpleGUI as sg |
3 | | - |
| 3 | +import sys |
4 | 4 | ''' |
5 | | - Usage of all Popups in PSG |
| 5 | + Usage of Popups in PSG |
| 6 | + |
| 7 | + While this is an older demo, it is a good instroduction to a FEW of the popups available to you. |
| 8 | + Check out the System Call Reference for the full list: http://www.PySimpleGUI.org |
| 9 | + |
| 10 | + Copyright 2022 PySimpleGUI |
| 11 | + |
6 | 12 | ''' |
7 | | - |
8 | | -sg.Print('test') |
9 | | -sg.popup_get_file('Get file', save_as=True, |
10 | | - file_types=(("ALL Files", "*.jpg"),)) |
11 | | - |
12 | 13 | # Here, have some windows on me.... |
13 | | -[sg.popup_no_wait('No-wait Popup', location=(500+100*x, 500)) |
14 | | - for x in range(10)] |
15 | | -answer = sg.popup_yes_no( |
16 | | - 'Do not worry about all those open windows... they will disappear at the end', 'Are you OK with that?') |
| 14 | +[sg.popup_no_wait('No-wait Popup', relative_location=(-500+100*x, -500)) for x in range(10)] |
| 15 | +answer = sg.popup_yes_no('Do not worry about all those open windows... they will disappear at the end', 'Are you OK with that?') |
17 | 16 |
|
18 | 17 | if answer == 'No': |
19 | | - sg.popup_cancel( |
20 | | - 'OK, we will destroy those windows as soon as you close this window') |
| 18 | + sg.popup_cancel('OK, we will destroy those windows as soon as you close this window') |
21 | 19 | sys.exit() |
22 | 20 |
|
23 | | -sg.popup_non_blocking('Your answer was', answer, location=(1000, 600)) |
24 | | -text = sg.popup_get_text( |
25 | | - 'This is a call to PopopGetText', location=(1000, 200)) |
| 21 | +sg.popup_no_buttons('Your answer was', answer, relative_location=(0, -200), non_blocking=True) |
| 22 | +text = sg.popup_get_text('This is a call to PopopGetText') |
26 | 23 | sg.popup_get_file('Get file') |
27 | 24 | sg.popup_get_folder('Get folder') |
28 | 25 | sg.popup('Simple popup') |
29 | 26 | sg.popup_no_titlebar('No titlebar') |
30 | 27 | sg.popup_no_border('No border') |
31 | 28 | sg.popup_no_frame('No frame') |
32 | 29 | sg.popup_cancel('Cancel') |
33 | | -sg.popup_okCancel('OK Cancel') |
34 | | -sg.popup_auto_close('Autoclose') |
| 30 | +sg.popup_auto_close('This window will Autoclose and then everything else will close too....') |
0 commit comments