2018-10-09 12:42:39 +00:00
|
|
|
#!/usr/bin/env python
|
2019-10-23 20:10:03 +00:00
|
|
|
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
|
|
|
|
2019-10-23 20:10:03 +00:00
|
|
|
window = sg.Window('My window', layout)
|
2018-10-09 12:42:39 +00:00
|
|
|
|
|
|
|
while True:
|
2019-10-23 20:10:03 +00:00
|
|
|
event, values = window.read()
|
2020-05-07 10:22:59 +00:00
|
|
|
if event == sg.WIN_CLOSED:
|
2018-10-09 12:42:39 +00:00
|
|
|
break
|
2018-10-15 20:07:23 +00:00
|
|
|
if event == 'Disappear':
|
2019-10-23 20:10:03 +00:00
|
|
|
window.disappear()
|
|
|
|
sg.popup('Click OK to make window reappear')
|
|
|
|
window.reappear()
|
2018-10-09 12:42:39 +00:00
|
|
|
|
2019-10-23 20:10:03 +00:00
|
|
|
window.close()
|