From 10dcee71bdd0fe5ad07f962deea741edf7bc6906 Mon Sep 17 00:00:00 2001 From: Dylan Gatlin Date: Sun, 9 Jan 2022 04:40:19 +0000 Subject: [PATCH 1/2] This throws lots of errors in STUI scripts --- python/RO/Wdg/LogWdg.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python/RO/Wdg/LogWdg.py b/python/RO/Wdg/LogWdg.py index 4c5241a..88f20a1 100755 --- a/python/RO/Wdg/LogWdg.py +++ b/python/RO/Wdg/LogWdg.py @@ -306,8 +306,11 @@ def isScrolledToEnd(self): # test two cases: # scrollPos[1] = 1.0: scrolled to end # scrollPos[1] = scrollPos[0]: window has not yet been painted - scrollPos = self.yscroll.get() - return scrollPos[1] == 1.0 or scrollPos[0] == scrollPos[1] + try: + scrollPos = self.yscroll.get() + return scrollPos[1] == 1.0 or scrollPos[0] == scrollPos[1] + except Tkinter.TclError: + return True def search(self, searchStr, backwards=False, doWrap=False, elide=True, noCase=False, regExp=False): """Find and select the next instance of a specified string. From 2eca4cbead61edf876b4371305498f17d830ba54 Mon Sep 17 00:00:00 2001 From: Dylan Gatlin Date: Sun, 9 Jan 2022 07:38:41 +0000 Subject: [PATCH 2/2] Another common bug --- python/RO/Wdg/StripChartWdg.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python/RO/Wdg/StripChartWdg.py b/python/RO/Wdg/StripChartWdg.py index e0116c6..9f4c429 100755 --- a/python/RO/Wdg/StripChartWdg.py +++ b/python/RO/Wdg/StripChartWdg.py @@ -410,7 +410,11 @@ def _redraw(self): """Redraw the graph """ self.line2d.set_data(self._tList, self._yList) - if not self._wdg.winfo_ismapped(): + try: + if not self._wdg.winfo_ismapped(): + return + except Tkinter.TclError as e: + # This means the window was probably closed return if len(self._yList) > 0: # see if limits need updating to include last point