From f239ab36ba94086d3c7f698db7caff007bc7f7e1 Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Sat, 5 Jun 2021 10:49:28 -0400 Subject: [PATCH] Invert colors of the "Refresh Button" while refresh is happening --- DemoPrograms/Demo_Desktop_Widget_FedEx_Package_Tracking.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/DemoPrograms/Demo_Desktop_Widget_FedEx_Package_Tracking.py b/DemoPrograms/Demo_Desktop_Widget_FedEx_Package_Tracking.py index 5645b506..0b5222a8 100644 --- a/DemoPrograms/Demo_Desktop_Widget_FedEx_Package_Tracking.py +++ b/DemoPrograms/Demo_Desktop_Widget_FedEx_Package_Tracking.py @@ -163,7 +163,11 @@ def main(): if choose_theme(loc) is not None: _, window = window.close(), make_window(loc) elif event in ('Refresh', sg.TIMEOUT_KEY): + # Invert colors of simulated "button" (Text Element) while the refresh is happening + window['Refresh'].update(text_color=sg.theme_text_element_background_color(), background_color=sg.theme_text_color()) + window.refresh() refresh(window) + window['Refresh'].update(text_color=sg.theme_text_color(), background_color=sg.theme_text_element_background_color()) elif event in [str(x) for x in range(1,11)]: window.set_alpha(int(event)/10) sg.user_settings_set_entry('-alpha-', int(event)/10)