PySimpleGUI/Demo_Window_Disappear.py

22 lines
470 B
Python
Raw Normal View History

2018-10-09 12:42:39 +00:00
#!/usr/bin/env python
import sys
if sys.version_info[0] >= 3:
import PySimpleGUI as sg
else:
import PySimpleGUI27 as sg
layout = [[ sg.Text('My Window') ],
[ sg.RButton('Disappear')]]
window = sg.Window('My window').Layout(layout)
while True:
event, values = window.Read()
if event is None:
2018-10-09 12:42:39 +00:00
break
if event == 'Disappear':
window.Disappear()
2018-10-09 12:42:39 +00:00
sg.Popup('Click OK to make window reappear')
window.Reappear()