Merge pull request #3239 from PySimpleGUI/Dev-latest

Added pin function to pin an element's location in a layout
This commit is contained in:
PySimpleGUI 2020-08-03 15:29:11 -04:00 committed by GitHub
commit 7334e78933
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 1 deletions

View File

@ -1,5 +1,5 @@
#!/usr/bin/python3 #!/usr/bin/python3
version = __version__ = "4.27.4.4 Unreleased\nAdded setting of combobox button color to be theme's button color, spin arrow color set to background color of spin, fix for error popup when bad key (thanks Ruud!), fixed background color for combo when readonly, added border_width to Canvas & Graph elems" version = __version__ = "4.27.4.5 Unreleased\nAdded setting of combobox button color to be theme's button color, spin arrow color set to background color of spin, fix for error popup when bad key (thanks Ruud!), fixed background color for combo when readonly, added border_width to Canvas & Graph elems, added pin function to pin an element's location in a layout"
port = 'PySimpleGUI' port = 'PySimpleGUI'
@ -9136,6 +9136,17 @@ def Sizer(h_pixels=0, v_pixels=0):
return Column([[]], pad=((h_pixels, 0), (v_pixels, 0))) return Column([[]], pad=((h_pixels, 0), (v_pixels, 0)))
def pin(elem):
'''
Pin's an element provided into a layout so that when it's made invisible and visible again, it will
be in the correct place. Otherwise it will be placed at the end of its containing window/column.
:param elem: the element to put into the layout
:return: A column element containing the provided element
'''
return Column([[elem, Canvas(size=(0,0), pad=(0,0))]], pad=(0,0))
# ------------------------- FOLDER BROWSE Element lazy function ------------------------- # # ------------------------- FOLDER BROWSE Element lazy function ------------------------- #
def FolderBrowse(button_text='Browse', target=(ThisRow, -1), initial_folder=None, tooltip=None, size=(None, None), def FolderBrowse(button_text='Browse', target=(ThisRow, -1), initial_folder=None, tooltip=None, size=(None, None),
auto_size_button=None, button_color=None, disabled=False, change_submits=False, enable_events=False, auto_size_button=None, button_color=None, disabled=False, change_submits=False, enable_events=False,