From c7fcd5063296a6a787363b168fd4f3dd3023a2a9 Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy Date: Sat, 16 Mar 2019 17:12:27 -0400 Subject: [PATCH] Enabled PopupAnimated to show file based GIFs, Added default title to be message in PopupGetFolder --- PySimpleGUI.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/PySimpleGUI.py b/PySimpleGUI.py index a2c64692..1065c6c0 100644 --- a/PySimpleGUI.py +++ b/PySimpleGUI.py @@ -3479,7 +3479,7 @@ class ErrorElement(Element): Stretch = ErrorElement # ------------------------------------------------------------------------- # -# Window CLASS # +# Window CLASS # # ------------------------------------------------------------------------- # class Window: NumOpenWindows = 0 @@ -7540,7 +7540,10 @@ def PopupAnimated(image_source, message=None, background_color=None, text_color= return if image_source not in Window.animated_popup_dict: - layout = [[Image(data=image_source, background_color=background_color, key='_IMAGE_',)],] + if type(image_source) is bytes: + layout = [[Image(data=image_source, background_color=background_color, key='_IMAGE_',)],] + else: + layout = [[Image(filename=image_source, background_color=background_color, key='_IMAGE_',)],] if message: layout.append([Text(message, background_color=background_color, text_color=text_color, font=font)])