From 6eb14b7408b885e5bdb00ff881430e6502312e95 Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Sun, 7 Aug 2022 07:36:15 -0400 Subject: [PATCH] Update Demo_Invisible_Elements_Pinning.py --- DemoPrograms/Demo_Invisible_Elements_Pinning.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/DemoPrograms/Demo_Invisible_Elements_Pinning.py b/DemoPrograms/Demo_Invisible_Elements_Pinning.py index 8e4fae74..fe9b9ce9 100644 --- a/DemoPrograms/Demo_Invisible_Elements_Pinning.py +++ b/DemoPrograms/Demo_Invisible_Elements_Pinning.py @@ -19,13 +19,12 @@ import PySimpleGUI as sg For other ports of PySimpleGUI such as the Qt port, the position is remembered by Qt and as a result this technique using "pin" is not needed. - Copyright 2020 PySimpleGUI.org + Copyright 2020, 2022 PySimpleGUI.org """ - layout = [ [sg.Text('Hide Button or Input. Button3 hides Input. Buttons 1 & 2 hide Button 2')], - [sg.pin(sg.Input(key='-IN-'))], - [sg.pin(sg.Button('Button1')), sg.pin(sg.Button('Button2')), sg.B('Button3')], + [sg.pin(sg.Multiline(size=(60, 10), key='-MLINE-'))], + [sg.pin(sg.Button('Button1')), sg.pin(sg.Button('Button2'), shrink=False), sg.B('Button3'), sg.B('Toggle Multiline')], ] window = sg.Window('Visible / Invisible Element Demo', layout) @@ -43,4 +42,6 @@ while True: # Event Loop if event == 'Button3': window['-IN-'].update(visible=toggle_in) toggle_in = not toggle_in + elif event == 'Toggle Multiline': + window['-MLINE-'].update(visible=not window['-MLINE-'].visible) window.close()