From 052db64ad512367bead593fa0b2205b1a65d0e0b Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy Date: Wed, 14 Nov 2018 09:13:39 -0500 Subject: [PATCH] Update method for Output Element --- PySimpleGUI.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/PySimpleGUI.py b/PySimpleGUI.py index 8ebeda03..4bc205d0 100644 --- a/PySimpleGUI.py +++ b/PySimpleGUI.py @@ -190,7 +190,6 @@ class MyWindows(): self.NumOpenWindows = 0 self.user_defined_icon = None self.hidden_master_root = None - self.window_being_closed = None def Decrement(self): self.NumOpenWindows -= 1 * (self.NumOpenWindows != 0) # decrement if not 0 @@ -1204,6 +1203,16 @@ class Output(Element): print('*** form = sg.Window("My Form").Layout(layout).Finalize() ***') return self._TKOut + + def Update(self, value=None): + if value is not None: + # try: + self._TKOut.output.delete('1.0', tk.END) + self._TKOut.output.insert(tk.END, value) + # except: + # pass + + def __del__(self): try: self._TKOut.__del__() @@ -3228,7 +3237,6 @@ class Window: global _my_windows if self.DisableClose: return - _my_windows.window_being_closed = self # print('Got closing callback') if self.CurrentlyRunningMainloop: # quit if this is the current mainloop, otherwise don't quit! self.TKroot.quit() # kick the users out of the mainloop