Merge pull request #454 from MikeTheWatchGuy/Dev-latest

Dev latest
This commit is contained in:
MikeTheWatchGuy 2018-10-09 08:43:13 -04:00 committed by GitHub
commit df2fbae33f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 0 deletions

21
Demo_Window_Disappear.py Normal file
View File

@ -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()

View File

@ -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