From f256b4331a7d2dc4731dc5b7ab1658c81ee16306 Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy Date: Fri, 14 Dec 2018 18:25:47 -0500 Subject: [PATCH] Pane Element - border_width parameter --- PySimpleGUI.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/PySimpleGUI.py b/PySimpleGUI.py index 00abd9c2..d224a5b0 100644 --- a/PySimpleGUI.py +++ b/PySimpleGUI.py @@ -2471,7 +2471,7 @@ class Column(Element): # Pane # # ---------------------------------------------------------------------- # class Pane(Element): - def __init__(self, pane_list, background_color=None, size=(None, None), pad=None, orientation='vertical', show_handle=True, relief=RELIEF_RAISED, handle_size=None, key=None, visible=True): + def __init__(self, pane_list, background_color=None, size=(None, None), pad=None, orientation='vertical', show_handle=True, relief=RELIEF_RAISED, handle_size=None, border_width=None, key=None, visible=True): ''' Container for elements that are stacked into rows :param layout: @@ -2496,7 +2496,7 @@ class Pane(Element): self.ShowHandle = show_handle self.Relief = relief self.HandleSize = handle_size or 8 - + self.BorderDepth = border_width bg = background_color if background_color is not None else DEFAULT_BACKGROUND_COLOR self.Rows = [pane_list] @@ -4401,9 +4401,11 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form): # ------------------------- Pane element ------------------------- # if element_type == ELEM_TYPE_PANE: - + bd = element.BorderDepth if element.BorderDepth is not None else border_depth element.PanedWindow = tk.PanedWindow(tk_row_frame, orient=tk.VERTICAL if element.Orientation.startswith('v') else tk.HORIZONTAL, + borderwidth=bd, + bd=bd, ) if element.Relief is not None: element.PanedWindow.configure(relief=element.Relief) @@ -4418,7 +4420,8 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form): pane.TKColFrame = tk.Frame(element.PanedWindow) pane.ParentPanedWindow = element.PanedWindow PackFormIntoFrame(pane, pane.TKColFrame, toplevel_form) - element.PanedWindow.add(pane.TKColFrame) + if pane.Visible: + element.PanedWindow.add(pane.TKColFrame) if pane.BackgroundColor != COLOR_SYSTEM_DEFAULT and pane.BackgroundColor is not None: pane.TKColFrame.configure(background=pane.BackgroundColor, highlightbackground=pane.BackgroundColor, highlightcolor=pane.BackgroundColor)