From 81abc21cf94a332e39bf09057897742ff5eea44a Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy Date: Mon, 16 Sep 2019 15:40:12 -0400 Subject: [PATCH 1/2] Title not a string check removed from Window, Element Justification fix for columns, etc. MAC FIX - using highlightbackground for background --- PySimpleGUI.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/PySimpleGUI.py b/PySimpleGUI.py index 2b87207f..339f84d4 100644 --- a/PySimpleGUI.py +++ b/PySimpleGUI.py @@ -5062,7 +5062,7 @@ class Window: self.AutoSizeText = auto_size_text if auto_size_text is not None else DEFAULT_AUTOSIZE_TEXT self.AutoSizeButtons = auto_size_buttons if auto_size_buttons is not None else DEFAULT_AUTOSIZE_BUTTONS - self.Title = title + self.Title = str(title) self.Rows = [] # a list of ELEMENTS for this row self.DefaultElementSize = default_element_size self.DefaultButtonElementSize = default_button_element_size if default_button_element_size != ( @@ -5123,8 +5123,6 @@ class Window: self.ElementJustification = element_justification self.FocusSet = False self.metadata = metadata - if type(title) != str: - warnings.warn('Your title is not a string. Are you passing in the right parameters?', UserWarning) if layout is not None and type(layout) not in (list, tuple): warnings.warn('Your layout is not a list or tuple... this is not good!') @@ -7455,7 +7453,7 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form): # *********** Make TK Row ***********# tk_row_frame = tk.Frame(containing_frame) row_should_expand = False - row_justify = '' + row_justify = form.ElementJustification for col_num, element in enumerate(flex_row): element.ParentRowFrame = tk_row_frame element.ParentForm = toplevel_form # save the button's parent form object @@ -7539,6 +7537,8 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form): else: anchor=tk.NW side = tk.LEFT + # anchor=tk.NW + # side = tk.LEFT row_justify = element.Justification element.Widget = element.TKColFrame element.TKColFrame.pack(side=side, anchor=anchor, padx=elementpad[0], pady=elementpad[1], expand=False, fill=tk.NONE) @@ -7684,7 +7684,10 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form): tkbutton.bind('', element.ButtonReleaseCallBack) tkbutton.bind('', element.ButtonPressCallBack) if bc != (None, None) and bc != COLOR_SYSTEM_DEFAULT and bc[1] != COLOR_SYSTEM_DEFAULT: - tkbutton.config(foreground=bc[0], background=bc[1], activebackground=bc[1]) + if sys.platform.startswith('darwin'): + tkbutton.config(foreground=bc[0], highlightbackground=bc[1], activebackground=bc[1]) + else: + tkbutton.config(foreground=bc[0], background=bc[1], activebackground=bc[1]) elif bc[1] == COLOR_SYSTEM_DEFAULT: tkbutton.config(foreground=bc[0]) if border_depth == 0: From abb0918dbdb767922bfc0088363a6a6345df2b51 Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy Date: Mon, 16 Sep 2019 15:40:53 -0400 Subject: [PATCH 2/2] Version bump --- PySimpleGUI.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PySimpleGUI.py b/PySimpleGUI.py index 339f84d4..46414d99 100644 --- a/PySimpleGUI.py +++ b/PySimpleGUI.py @@ -1,5 +1,5 @@ #!/usr/bin/python3 -version = __version__ = "4.5.0.5 Unreleased Metadata & Mac Button Test" +version = __version__ = "4.5.0.6 Unreleased Mac Buttons Justify fix" # 888888ba .d88888b oo dP .88888. dP dP dP