From 9f8404ffd36ae06c674a8190a38dd87f8b3f0fe4 Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Fri, 19 Jun 2020 07:25:59 -0400 Subject: [PATCH] New Demo for the Vertical and (new) Horizontal separator elements --- DemoPrograms/Demo_Separator_Elements.py | 37 +++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 DemoPrograms/Demo_Separator_Elements.py diff --git a/DemoPrograms/Demo_Separator_Elements.py b/DemoPrograms/Demo_Separator_Elements.py new file mode 100644 index 00000000..a73e2fc6 --- /dev/null +++ b/DemoPrograms/Demo_Separator_Elements.py @@ -0,0 +1,37 @@ +import PySimpleGUIWx as sg + +""" + Demo - Separator Elements + + Shows usage of both Horizontal and Vertical Separator Elements + Vertical Separators are placed BETWEEN 2 elements ON the same row. These work well when one + of the elements is a Column or the element spans several rows + + Horizontal separators are placed BETWEEN 2 rows. They will occupy the entire span of the row they + are located on. If that row is constrained within a container, then it will spand the widget of + the container. + + Copyright 2020 PySimpleGUI.org +""" + + +left_col = sg.Column([[sg.Listbox((1,2,3,4,5,6), size=(6,4))]]) + +right_col = sg.Column([[sg.Input(), sg.Input()], + [sg.HorizontalSeparator()], + [sg.Column([[sg.In()], [sg.HorizontalSeparator()]], pad=(0,0))],]) + +layout = [ + [sg.Text('Window with some separators')], + [left_col, sg.VerticalSeparator(), right_col], + [sg.Button('Go'), sg.Button('Exit')] + ] + +window = sg.Window('Window Title', layout) + +while True: # Event Loop + event, values = window.read() + print(event, values) + if event == sg.WIN_CLOSED or event == 'Exit': + break +window.close()