From 66210a7f38bff3c19b2cd58c2dc8cba97f96addc Mon Sep 17 00:00:00 2001 From: Orsiris de Jong Date: Tue, 5 Mar 2019 12:34:06 +0100 Subject: [PATCH] Allow custom icon to work via SetOptions --- PySimpleGUIWx/PySimpleGUIWx.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/PySimpleGUIWx/PySimpleGUIWx.py b/PySimpleGUIWx/PySimpleGUIWx.py index bcf09323..e15c4c48 100644 --- a/PySimpleGUIWx/PySimpleGUIWx.py +++ b/PySimpleGUIWx/PySimpleGUIWx.py @@ -2985,7 +2985,7 @@ class Window: self.Font = font if font else DEFAULT_FONT self.RadioDict = {} self.BorderDepth = border_depth - self.WindowIcon = icon if icon is not None else Window.user_defined_icon + self.WindowIcon = Window.user_defined_icon if Window.user_defined_icon is not None else icon if icon is not None else DEFAULT_WINDOW_ICON self.AutoClose = auto_close self.NonBlocking = False self.TKroot = None @@ -5803,15 +5803,8 @@ def SetOptions(icon=None, button_color=None, element_size=(None, None), button_e global DEFAULT_ELEMENT_TEXT_COLOR global DEFAULT_INPUT_TEXT_COLOR global DEFAULT_TOOLTIP_TIME - global _my_windows - if icon: - try: - with open(icon, 'r') as icon_file: - pass - except: - raise FileNotFoundError - _my_windows.user_defined_icon = icon + Window.user_defined_icon = icon if button_color != None: DEFAULT_BUTTON_COLOR = button_color