Added check for None when setting icon using SetOptions
This commit is contained in:
parent
5d03a00f0b
commit
673f5f68a0
|
@ -5746,14 +5746,8 @@ ScrolledTextBox = PopupScrolled
|
||||||
# Sets the icon to be used by default #
|
# Sets the icon to be used by default #
|
||||||
# ===================================================#
|
# ===================================================#
|
||||||
def SetGlobalIcon(icon):
|
def SetGlobalIcon(icon):
|
||||||
global _my_windows
|
if icon is not None:
|
||||||
|
Window.user_defined_icon = icon
|
||||||
try:
|
|
||||||
with open(icon, 'r') as icon_file:
|
|
||||||
pass
|
|
||||||
except:
|
|
||||||
raise FileNotFoundError
|
|
||||||
_my_windows.user_defined_icon = icon
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
@ -5804,6 +5798,7 @@ def SetOptions(icon=None, button_color=None, element_size=(None, None), button_e
|
||||||
global DEFAULT_INPUT_TEXT_COLOR
|
global DEFAULT_INPUT_TEXT_COLOR
|
||||||
global DEFAULT_TOOLTIP_TIME
|
global DEFAULT_TOOLTIP_TIME
|
||||||
|
|
||||||
|
if icon is not None:
|
||||||
Window.user_defined_icon = icon
|
Window.user_defined_icon = icon
|
||||||
|
|
||||||
if button_color != None:
|
if button_color != None:
|
||||||
|
@ -6882,6 +6877,7 @@ def PopupGetText(message, title=None, default_text='', password_char='', size=(N
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
ChangeLookAndFeel('GreenTan')
|
ChangeLookAndFeel('GreenTan')
|
||||||
|
|
||||||
layout = [
|
layout = [
|
||||||
[Text('Welcome to PySimpleGUI!', font='Arial 15', text_color='red')],
|
[Text('Welcome to PySimpleGUI!', font='Arial 15', text_color='red')],
|
||||||
[Text('You should be importing this module rather than running it', justification='l', size=(50, 1))],
|
[Text('You should be importing this module rather than running it', justification='l', size=(50, 1))],
|
||||||
|
|
Loading…
Reference in New Issue