2018-09-27 20:24:09 +00:00
|
|
|
#!/usr/bin/env python
|
2019-10-23 20:10:03 +00:00
|
|
|
import PySimpleGUI as sg
|
2022-02-22 10:35:02 +00:00
|
|
|
import sys
|
2019-10-23 20:10:03 +00:00
|
|
|
'''
|
2022-02-22 10:35:02 +00:00
|
|
|
Usage of Popups in PSG
|
|
|
|
|
|
|
|
While this is an older demo, it is a good instroduction to a FEW of the popups available to you.
|
|
|
|
Check out the System Call Reference for the full list: http://www.PySimpleGUI.org
|
|
|
|
|
|
|
|
Copyright 2022 PySimpleGUI
|
|
|
|
|
2019-10-23 20:10:03 +00:00
|
|
|
'''
|
2018-09-20 14:41:47 +00:00
|
|
|
# Here, have some windows on me....
|
2022-02-22 10:35:02 +00:00
|
|
|
[sg.popup_no_wait('No-wait Popup', relative_location=(-500+100*x, -500)) for x in range(10)]
|
|
|
|
answer = sg.popup_yes_no('Do not worry about all those open windows... they will disappear at the end', 'Are you OK with that?')
|
2018-09-14 16:17:19 +00:00
|
|
|
|
2018-09-29 17:48:48 +00:00
|
|
|
if answer == 'No':
|
2022-02-22 10:35:02 +00:00
|
|
|
sg.popup_cancel('OK, we will destroy those windows as soon as you close this window')
|
2018-09-29 17:48:48 +00:00
|
|
|
sys.exit()
|
|
|
|
|
2022-02-22 10:35:02 +00:00
|
|
|
sg.popup_no_buttons('Your answer was', answer, relative_location=(0, -200), non_blocking=True)
|
|
|
|
text = sg.popup_get_text('This is a call to PopopGetText')
|
2019-10-23 20:10:03 +00:00
|
|
|
sg.popup_get_file('Get file')
|
|
|
|
sg.popup_get_folder('Get folder')
|
|
|
|
sg.popup('Simple popup')
|
|
|
|
sg.popup_no_titlebar('No titlebar')
|
|
|
|
sg.popup_no_border('No border')
|
|
|
|
sg.popup_no_frame('No frame')
|
|
|
|
sg.popup_cancel('Cancel')
|
2022-02-22 10:35:02 +00:00
|
|
|
sg.popup_auto_close('This window will Autoclose and then everything else will close too....')
|