From be6ee091b1bf380ad7a49b4ad79c01248fd75649 Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy Date: Thu, 6 Sep 2018 15:25:05 -0400 Subject: [PATCH] Fix for checkbox background color being set to system default. --- PySimpleGUI.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/PySimpleGUI.py b/PySimpleGUI.py index bd48ec03..e0764e65 100644 --- a/PySimpleGUI.py +++ b/PySimpleGUI.py @@ -994,8 +994,10 @@ class Image(Element): else: image = data else: return - width, height = image.width(), image.height() - self.tktext_label.configure(image=image, width=width, height=height) + # width, height = image.width(), image.height() + # width, height = image.width(), image.height() + # self.tktext_label.configure(image=image, width=width, height=height) + self.tktext_label.configure(image=image) self.tktext_label.image = image def __del__(self): @@ -2441,7 +2443,10 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form): width, height = photo.width(), photo.height() else: width, height = element_size - element.tktext_label = tk.Label(tk_row_frame, image=photo, width=width, height=height, bd=border_depth) + if photo is not None: + element.tktext_label = tk.Label(tk_row_frame, image=photo, width=width, height=height, bd=border_depth) + else: + element.tktext_label = tk.Label(tk_row_frame, width=width, height=height, bd=border_depth) element.tktext_label.image = photo # tktext_label.configure(anchor=tk.NW, image=photo) element.tktext_label.pack(side=tk.LEFT, padx=element.Pad[0],pady=element.Pad[1])