From 845e5ce6200c06ff9eb91bf8462443e7d7138f69 Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy Date: Sat, 11 May 2019 07:02:25 -0400 Subject: [PATCH] Addition of Button.Click() method --- PySimpleGUI.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/PySimpleGUI.py b/PySimpleGUI.py index b8fc6c67..56e14649 100644 --- a/PySimpleGUI.py +++ b/PySimpleGUI.py @@ -1698,6 +1698,17 @@ class Button(Element): 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): try: self.TKButton.__del__()