commit
df2fbae33f
|
@ -0,0 +1,21 @@
|
|||
#!/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:
|
||||
button, value = window.Read()
|
||||
if button is None:
|
||||
break
|
||||
if button == 'Disappear':
|
||||
window.Disapper()
|
||||
sg.Popup('Click OK to make window reappear')
|
||||
window.Reappear()
|
||||
|
|
@ -2677,6 +2677,11 @@ class Window:
|
|||
def UnHide(self):
|
||||
self.TKroot.deiconify()
|
||||
|
||||
def Disapper(self):
|
||||
self.TKroot.attributes('-alpha', 0)
|
||||
|
||||
def Reappear(self):
|
||||
self.TKroot.attributes('-alpha', 255)
|
||||
|
||||
def __enter__(self):
|
||||
return self
|
||||
|
|
Loading…
Reference in New Issue