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') ],
|
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(layout)
|
|
|
|
|
|
|
|
while True:
|
2018-10-15 20:07:23 +00:00
|
|
|
event, values = window.Read()
|
|
|
|
if event is None:
|
2018-10-09 12:42:39 +00:00
|
|
|
break
|
2018-10-15 20:07:23 +00:00
|
|
|
if event == 'Disappear':
|
|
|
|
window.Disappear()
|
2018-10-09 12:42:39 +00:00
|
|
|
sg.Popup('Click OK to make window reappear')
|
|
|
|
window.Reappear()
|
|
|
|
|