Moved update animation call to after check for window closed. Was getting an error because attempt to update animation was happening after window was closed
This commit is contained in:
parent
71c50d40b4
commit
fb5fdbdd5c
|
@ -11,7 +11,7 @@
|
||||||
Displays the values dictionary entry for each element
|
Displays the values dictionary entry for each element
|
||||||
And more!
|
And more!
|
||||||
|
|
||||||
Copyright 2021, 2022 PySimpleGUI
|
Copyright 2021, 2022, 2023 PySimpleGUI
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import PySimpleGUI as sg
|
import PySimpleGUI as sg
|
||||||
|
@ -99,7 +99,6 @@ def main():
|
||||||
while True:
|
while True:
|
||||||
event, values = window.read(timeout=100)
|
event, values = window.read(timeout=100)
|
||||||
# keep an animation running so show things are happening
|
# keep an animation running so show things are happening
|
||||||
window['-GIF-IMAGE-'].update_animation(sg.DEFAULT_BASE64_LOADING_GIF, time_between_frames=100)
|
|
||||||
if event not in (sg.TIMEOUT_EVENT, sg.WIN_CLOSED):
|
if event not in (sg.TIMEOUT_EVENT, sg.WIN_CLOSED):
|
||||||
print('============ Event = ', event, ' ==============')
|
print('============ Event = ', event, ' ==============')
|
||||||
print('-------- Values Dictionary (key=value) --------')
|
print('-------- Values Dictionary (key=value) --------')
|
||||||
|
@ -108,7 +107,9 @@ def main():
|
||||||
if event in (None, 'Exit'):
|
if event in (None, 'Exit'):
|
||||||
print("[LOG] Clicked Exit!")
|
print("[LOG] Clicked Exit!")
|
||||||
break
|
break
|
||||||
elif event == 'About':
|
|
||||||
|
window['-GIF-IMAGE-'].update_animation(sg.DEFAULT_BASE64_LOADING_GIF, time_between_frames=100)
|
||||||
|
if event == 'About':
|
||||||
print("[LOG] Clicked About!")
|
print("[LOG] Clicked About!")
|
||||||
sg.popup('PySimpleGUI Demo All Elements',
|
sg.popup('PySimpleGUI Demo All Elements',
|
||||||
'Right click anywhere to see right click menu',
|
'Right click anywhere to see right click menu',
|
||||||
|
|
Loading…
Reference in New Issue