Update method for Output Element
This commit is contained in:
parent
fd53b79fdb
commit
052db64ad5
|
@ -190,7 +190,6 @@ class MyWindows():
|
||||||
self.NumOpenWindows = 0
|
self.NumOpenWindows = 0
|
||||||
self.user_defined_icon = None
|
self.user_defined_icon = None
|
||||||
self.hidden_master_root = None
|
self.hidden_master_root = None
|
||||||
self.window_being_closed = None
|
|
||||||
|
|
||||||
def Decrement(self):
|
def Decrement(self):
|
||||||
self.NumOpenWindows -= 1 * (self.NumOpenWindows != 0) # decrement if not 0
|
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() ***')
|
print('*** form = sg.Window("My Form").Layout(layout).Finalize() ***')
|
||||||
return self._TKOut
|
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):
|
def __del__(self):
|
||||||
try:
|
try:
|
||||||
self._TKOut.__del__()
|
self._TKOut.__del__()
|
||||||
|
@ -3228,7 +3237,6 @@ class Window:
|
||||||
global _my_windows
|
global _my_windows
|
||||||
if self.DisableClose:
|
if self.DisableClose:
|
||||||
return
|
return
|
||||||
_my_windows.window_being_closed = self
|
|
||||||
# print('Got closing callback')
|
# print('Got closing callback')
|
||||||
if self.CurrentlyRunningMainloop: # quit if this is the current mainloop, otherwise don't quit!
|
if self.CurrentlyRunningMainloop: # quit if this is the current mainloop, otherwise don't quit!
|
||||||
self.TKroot.quit() # kick the users out of the mainloop
|
self.TKroot.quit() # kick the users out of the mainloop
|
||||||
|
|
Loading…
Reference in New Issue