Skip to content

Commit 73e2630

Browse files
authored
Merge pull request PySimpleGUI#5219 from PySimpleGUI/Dev-latest
Another Demo Program refresh...
2 parents e7e8501 + 8155826 commit 73e2630

File tree

1 file changed

+14
-18
lines changed

1 file changed

+14
-18
lines changed

DemoPrograms/Demo_Popups.py

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,30 @@
11
#!/usr/bin/env python
22
import PySimpleGUI as sg
3-
3+
import sys
44
'''
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+
612
'''
7-
8-
sg.Print('test')
9-
sg.popup_get_file('Get file', save_as=True,
10-
file_types=(("ALL Files", "*.jpg"),))
11-
1213
# 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?')
1716

1817
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')
2119
sys.exit()
2220

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')
2623
sg.popup_get_file('Get file')
2724
sg.popup_get_folder('Get folder')
2825
sg.popup('Simple popup')
2926
sg.popup_no_titlebar('No titlebar')
3027
sg.popup_no_border('No border')
3128
sg.popup_no_frame('No frame')
3229
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

Comments
 (0)