Merge pull request #1394 from PySimpleGUI/Dev-latest

Addition of Button.Click() method
This commit is contained in:
MikeTheWatchGuy 2019-05-11 07:02:47 -04:00 committed by GitHub
commit 70efa14d5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 0 deletions

View File

@ -1698,6 +1698,17 @@ class Button(Element):
pass pass
def Click(self):
"""
Generates a click of the button as if the user clicked the button
:return:
"""
try:
self.TKButton.invoke()
except:
print('Exception clicking button')
def __del__(self): def __del__(self):
try: try:
self.TKButton.__del__() self.TKButton.__del__()