From 8155826734cfdf8c480fd6bd06844ca78d2c90fa Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Tue, 22 Feb 2022 05:35:02 -0500 Subject: [PATCH] Another Demo Program refresh... --- DemoPrograms/Demo_Popups.py | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/DemoPrograms/Demo_Popups.py b/DemoPrograms/Demo_Popups.py index 6ba21181..6e487e29 100644 --- a/DemoPrograms/Demo_Popups.py +++ b/DemoPrograms/Demo_Popups.py @@ -1,28 +1,25 @@ #!/usr/bin/env python import PySimpleGUI as sg - +import sys ''' - Usage of all Popups in PSG + 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 + ''' - -sg.Print('test') -sg.popup_get_file('Get file', save_as=True, - file_types=(("ALL Files", "*.jpg"),)) - # Here, have some windows on me.... -[sg.popup_no_wait('No-wait Popup', 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?') +[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?') if answer == 'No': - sg.popup_cancel( - 'OK, we will destroy those windows as soon as you close this window') + sg.popup_cancel('OK, we will destroy those windows as soon as you close this window') sys.exit() -sg.popup_non_blocking('Your answer was', answer, location=(1000, 600)) -text = sg.popup_get_text( - 'This is a call to PopopGetText', location=(1000, 200)) +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') sg.popup_get_file('Get file') sg.popup_get_folder('Get folder') sg.popup('Simple popup') @@ -30,5 +27,4 @@ sg.popup_no_titlebar('No titlebar') sg.popup_no_border('No border') sg.popup_no_frame('No frame') sg.popup_cancel('Cancel') -sg.popup_okCancel('OK Cancel') -sg.popup_auto_close('Autoclose') +sg.popup_auto_close('This window will Autoclose and then everything else will close too....')