Merge pull request #1872 from PySimpleGUI/Dev-latest

Removed the F-bomb because kids the source. If icon loads fail, defau…
This commit is contained in:
PySimpleGUI 2019-08-23 21:48:11 -04:00 committed by GitHub
commit 631fb775d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 3 deletions

View File

@ -57,7 +57,7 @@ This notice, these first 100 lines of code shall remain unchanged
88888888 "Y8888P88 888 88888888 "Y8888P" 88888888 "Y8888P88 888 88888888 "Y8888P"
And just what the fuck is that? Well, it's LPGL3+ and these FOUR simple stipulations. And just what is that? Well, it's LPGL3+ and these FOUR simple stipulations.
1. These and all comments are to remain in this document 1. These and all comments are to remain in this document
2. You will not post this software in a repository or a location for others to download from: 2. You will not post this software in a repository or a location for others to download from:
A. Unless you have made 10 lines of changes A. Unless you have made 10 lines of changes
@ -5231,9 +5231,16 @@ class Window:
try: try:
# print(f'icon bitmap = {wicon}') # print(f'icon bitmap = {wicon}')
self.TKroot.iconbitmap(wicon) self.TKroot.iconbitmap(wicon)
except:
# if can't set trying any other ways, just default to the built-in icon
try:
wicon = tkinter.PhotoImage(data=DEFAULT_BASE64_ICON)
try:
self.TKroot.tk.call('wm', 'iconphoto', self.TKroot._w, wicon)
except:
pass
except: except:
pass pass
def _GetElementAtLocation(self, location): def _GetElementAtLocation(self, location):
""" """
@ -8174,6 +8181,7 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
toplevel_form.TKroot.configure(menu=element.TKMenu) toplevel_form.TKroot.configure(menu=element.TKMenu)
# ------------------------- Frame element ------------------------- # # ------------------------- Frame element ------------------------- #
elif element_type == ELEM_TYPE_FRAME: elif element_type == ELEM_TYPE_FRAME:
element = element # type: Frame
labeled_frame = element.Widget = tk.LabelFrame(tk_row_frame, text=element.Title, relief=element.Relief) labeled_frame = element.Widget = tk.LabelFrame(tk_row_frame, text=element.Title, relief=element.Relief)
element.TKFrame = labeled_frame element.TKFrame = labeled_frame
PackFormIntoFrame(element, labeled_frame, toplevel_form) PackFormIntoFrame(element, labeled_frame, toplevel_form)