I have an app that uses MDIParentFrame and aui Manager. If I create a child frame and
then try to close the MDIParent frame I get and error. I do not get this error if I import aui
from wx.aui only when I import wx.lib.agw.aui. I traced the error back to OnChildFocus() located
in the AuiManager. I placed the following code around line 9155 in framemanager.py and have it
working now but im not sure if my fix is ok.
I believe this is a problem related to the fact that an UI update event inside agw lib gets in the way while closing, manually closing all mdi childs before closing mdiframe seems to work for me:
Try the changes:
class MDIFrame(wx.MDIParentFrame):
.....
self.Bind(wx.EVT_CLOSE, self.OnCloseMe)
......
def OnCloseMe(self, evt):
for child in self.GetChildren():
if isinstance(child, wx.MDIChildFrame):
child.Close()
... I'm also noting that if you place focus on one of the DummyPanel panels the same error occasionally occurs (btw those panels I'd reparent to the notebook??), perhaps it would be better to close all managed panels/windows before closing, unless there's a better way that I'm not aware of.