From 50261625a45c08693b7ce3a2130c79faa8254de0 Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy Date: Sun, 23 Sep 2018 12:10:25 -0400 Subject: [PATCH] Addec chaining capability to Finalize method... more compacting the user's code! --- PySimpleGUI.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/PySimpleGUI.py b/PySimpleGUI.py index d1f7b02c..4d9fab53 100644 --- a/PySimpleGUI.py +++ b/PySimpleGUI.py @@ -2001,9 +2001,23 @@ class FlexForm: # return None, None return BuildResults(self, False, self) + + def Finalize(self): + if self.TKrootDestroyed: + return self + if not self.Shown: + self.Show(non_blocking=True) + try: + rc = self.TKroot.update() + except: + self.TKrootDestroyed = True + _my_windows.Decrement() + # return None, None + return self + # Another name for ReadNonBlocking. PrepareForUpdate = ReadNonBlocking - Finalize = ReadNonBlocking + # Finalize = ReadNonBlocking PreRead = ReadNonBlocking