PySimpleGUI/DemoPrograms/Demo_Window_Disappear.py

21 lines
459 B
Python
Raw Normal View History

2018-10-09 12:42:39 +00:00
#!/usr/bin/env python
import PySimpleGUI as sg
# Example .disappear() .reappear() methods in window
2018-10-09 12:42:39 +00:00
layout = [[ sg.Text('My Window') ],
2018-10-29 00:01:03 +00:00
[ sg.Button('Disappear')]]
2018-10-09 12:42:39 +00:00
window = sg.Window('My window', layout)
2018-10-09 12:42:39 +00:00
while True:
event, values = window.read()
if event == sg.WIN_CLOSED:
2018-10-09 12:42:39 +00:00
break
if event == 'Disappear':
window.disappear()
sg.popup('Click OK to make window reappear')
window.reappear()
2018-10-09 12:42:39 +00:00
window.close()