Merge pull request #1492 from PySimpleGUI/Dev-latest

New Window methods - GrabAnywhereOn, GrabAnywhereOff
This commit is contained in:
MikeTheWatchGuy 2019-05-29 14:10:59 -04:00 committed by GitHub
commit d5f6842967
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -4213,6 +4213,16 @@ class Window:
except:
print('Transparent color not supported on this platform (windows only)')
def GrabAnyWhereOn(self):
self.TKroot.bind("<ButtonPress-1>", self.StartMove)
self.TKroot.bind("<ButtonRelease-1>", self.StopMove)
self.TKroot.bind("<B1-Motion>", self.OnMotion)
def GrabAnyWhereOff(self):
self.TKroot.unbind("<ButtonPress-1>")
self.TKroot.unbind("<ButtonRelease-1>")
self.TKroot.unbind("<B1-Motion>")
def __enter__(self):
return self