MCPcopy
hub / github.com/PySimpleGUI/PySimpleGUI / is_closed

Method is_closed

PySimpleGUI/PySimpleGUI.py:11595–11617  ·  view source on GitHub ↗

Returns True is the window is maybe closed. Can be difficult to tell sometimes NOTE - the call to TKroot.update was taking over 500 ms sometimes so added a flag to bypass the lengthy call. :param quick_quick: If True, then don't use the root.update call, only check the flag

(self, quick_check=None)

Source from the content-addressed store, hash-verified

11593 self.TKroot = None
11594
11595 def is_closed(self, quick_check=None):
11596 """
11597 Returns True is the window is maybe closed. Can be difficult to tell sometimes
11598 NOTE - the call to TKroot.update was taking over 500 ms sometimes so added a flag to bypass the lengthy call.
11599 :param quick_quick: If True, then don't use the root.update call, only check the flags
11600 :type quick_check: bool
11601 :return: True if the window was closed or destroyed
11602 :rtype: (bool)
11603 """
11604
11605 if self.TKrootDestroyed or self.TKroot is None:
11606 return True
11607
11608 # if performing a quick check only, then skip calling tkinter for performance reasons
11609 if quick_check is True:
11610 return False
11611
11612 # see if can do an update... if not, then it's been destroyed
11613 try:
11614 rc = self.TKroot.update()
11615 except:
11616 return True
11617 return False
11618
11619 def _auto_save_location(self):
11620 """

Callers 4

_restore_stdoutMethod · 0.80
_restore_stderrMethod · 0.80
reopen_windowMethod · 0.80

Calls 1

updateMethod · 0.45

Tested by

no test coverage detected