From e790b938ed9641958b2a420e2167a2b75155247a Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Sun, 15 Dec 2019 21:54:16 -0500 Subject: [PATCH 1/2] Spinbox skip setting default is None provided, expand_row = True by default in Element.expand --- PySimpleGUI.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PySimpleGUI.py b/PySimpleGUI.py index 8b8368f7..26601d18 100644 --- a/PySimpleGUI.py +++ b/PySimpleGUI.py @@ -1,6 +1,6 @@ #!/usr/bin/python3 -version = __version__ = "4.12.0.1 Unreleased - Element.expand added expand_row parm" +version = __version__ = "4.12.0.2 Unreleased - Element.expand added expand_row parm, spin - defaults to first entry if none specified" port = 'PySimpleGUI' @@ -865,7 +865,6 @@ class Element(): except: print('Warning, error hiding element row for key =', self.Key) - def expand(self, expand_x=False, expand_y=False, expand_row=False): """ Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions @@ -8582,7 +8581,8 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form): element.TKSpinBox = element.Widget = tk.Spinbox(tk_row_frame, values=element.Values, textvariable=element.TKStringVar, width=width, bd=border_depth) - element.TKStringVar.set(element.DefaultValue) + if element.DefaultValue is not None: + element.TKStringVar.set(element.DefaultValue) element.TKSpinBox.configure(font=font) # set wrap to width of widget if element.BackgroundColor is not None and element.BackgroundColor != COLOR_SYSTEM_DEFAULT: element.TKSpinBox.configure(background=element.BackgroundColor) From fa7178850fed11020ad0c621596d93aa86db9eb5 Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Sun, 15 Dec 2019 21:55:21 -0500 Subject: [PATCH 2/2] Expand_row should default to true --- PySimpleGUI.py | 1 + 1 file changed, 1 insertion(+) diff --git a/PySimpleGUI.py b/PySimpleGUI.py index 26601d18..3ef7fd66 100644 --- a/PySimpleGUI.py +++ b/PySimpleGUI.py @@ -865,6 +865,7 @@ class Element(): except: print('Warning, error hiding element row for key =', self.Key) + def expand(self, expand_x=False, expand_y=False, expand_row=True): """ Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions