Spinbox skip setting default is None provided, expand_row = True by default in Element.expand

This commit is contained in:
PySimpleGUI 2019-12-15 21:54:16 -05:00
parent c126e8fd7e
commit e790b938ed
1 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
#!/usr/bin/python3 #!/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' port = 'PySimpleGUI'
@ -865,7 +865,6 @@ class Element():
except: except:
print('Warning, error hiding element row for key =', self.Key) 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 Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions
@ -8582,6 +8581,7 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
element.TKSpinBox = element.Widget = tk.Spinbox(tk_row_frame, values=element.Values, element.TKSpinBox = element.Widget = tk.Spinbox(tk_row_frame, values=element.Values,
textvariable=element.TKStringVar, textvariable=element.TKStringVar,
width=width, bd=border_depth) width=width, bd=border_depth)
if element.DefaultValue is not None:
element.TKStringVar.set(element.DefaultValue) element.TKStringVar.set(element.DefaultValue)
element.TKSpinBox.configure(font=font) # set wrap to width of widget element.TKSpinBox.configure(font=font) # set wrap to width of widget
if element.BackgroundColor is not None and element.BackgroundColor != COLOR_SYSTEM_DEFAULT: if element.BackgroundColor is not None and element.BackgroundColor != COLOR_SYSTEM_DEFAULT: