Skip to content

Commit 9692dd1

Browse files
authored
Merge pull request PySimpleGUI#5766 from PySimpleGUI/Dev-latest
Update Demo_Invisible_Elements_Pinning.py
2 parents 1c2aa9d + 6eb14b7 commit 9692dd1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

DemoPrograms/Demo_Invisible_Elements_Pinning.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,12 @@
1919
For other ports of PySimpleGUI such as the Qt port, the position is remembered by Qt and as a
2020
result this technique using "pin" is not needed.
2121
22-
Copyright 2020 PySimpleGUI.org
22+
Copyright 2020, 2022 PySimpleGUI.org
2323
"""
2424

25-
2625
layout = [ [sg.Text('Hide Button or Input. Button3 hides Input. Buttons 1 & 2 hide Button 2')],
27-
[sg.pin(sg.Input(key='-IN-'))],
28-
[sg.pin(sg.Button('Button1')), sg.pin(sg.Button('Button2')), sg.B('Button3')],
26+
[sg.pin(sg.Multiline(size=(60, 10), key='-MLINE-'))],
27+
[sg.pin(sg.Button('Button1')), sg.pin(sg.Button('Button2'), shrink=False), sg.B('Button3'), sg.B('Toggle Multiline')],
2928
]
3029

3130
window = sg.Window('Visible / Invisible Element Demo', layout)
@@ -43,4 +42,6 @@
4342
if event == 'Button3':
4443
window['-IN-'].update(visible=toggle_in)
4544
toggle_in = not toggle_in
45+
elif event == 'Toggle Multiline':
46+
window['-MLINE-'].update(visible=not window['-MLINE-'].visible)
4647
window.close()

0 commit comments

Comments
 (0)