From e4cb183ff73a6e99a24726103085f86cd898d6b4 Mon Sep 17 00:00:00 2001 From: Jorge Moraleda Date: Thu, 18 Jan 2024 22:18:01 -0500 Subject: [PATCH] Multiple bugfixes in pure python aui --- wx/lib/agw/aui/auibook.py | 3 ++- wx/lib/agw/aui/framemanager.py | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/wx/lib/agw/aui/auibook.py b/wx/lib/agw/aui/auibook.py index d07637fe..c63e31ec 100644 --- a/wx/lib/agw/aui/auibook.py +++ b/wx/lib/agw/aui/auibook.py @@ -2457,7 +2457,8 @@ class AuiTabCtrl(wx.Control, AuiTabContainer): :rtype: :class:`wx.Window`. """ - + if not self: + return None # The AuiTabCtrl has already been destroyed screen_pt = wx.GetMousePosition() client_pt = self.ScreenToClient(screen_pt) return self.TabHitTest(client_pt.x, client_pt.y) diff --git a/wx/lib/agw/aui/framemanager.py b/wx/lib/agw/aui/framemanager.py index 0c5f5643..7cd5846e 100644 --- a/wx/lib/agw/aui/framemanager.py +++ b/wx/lib/agw/aui/framemanager.py @@ -8435,6 +8435,10 @@ class AuiManager(wx.EvtHandler): not part.sizer_item.IsShown()): continue + # don't draw items that have a pane whose window has been deleted + if part.pane and not part.pane.window: + continue + ptype = part.type if ptype in [AuiDockUIPart.typeDockSizer, AuiDockUIPart.typePaneSizer]: