Hello, I am the newbie on wxPython.
When I try to run application implemented using wxPython, it is crashed on MacOS.
On the other platform CentOS7, Ubuntu, Windows, there is no crash.
The root cause is wx.auiManager(), When I call SetManagedWindow(panel), it crashes.
I have two questions.
- What causes this crash, it there different rule that I may miss?
- How cloud I debug where is the main point that make it crash?
To debug, I download source code archive, install gdb and codesigned on my MacOS, I installed wxPython by pip install -e .
on my extracted directory. then start gdb and run it run app.py
It makes another error
Traceback (most recent call last):
File "/Users/universehan/workspace/alsemy/reproduce-wxcrash/main.py", line 1, in <module>
import wx
File "/Users/universehan/opensource/wxPython-4.1.1/wx/__init__.py", line 17, in <module>
from wx.core import *
File "/Users/universehan/opensource/wxPython-4.1.1/wx/core.py", line 12, in <module>
from ._core import *
ModuleNotFoundError: No module named 'wx._core'
The simple source code which reproduce this problem is
class EmptyPanel(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent)
self.mgr = aui.AuiManager()
self.mgr.SetManagedWindow(self)
class SimpleChildFrame(aui.AuiMDIChildFrame):
def __init__(self, parent):
aui.AuiMDIChildFrame.__init__(self, parent, -1, title="Test")
self.p = EmptyPanel(self)
class TopFrame(aui.AuiMDIParentFrame):
def __init__(self, parent):
aui.AuiMDIParentFrame.__init__(self, parent, -1, "Test Application", size=(1500, 800),
style=wx.DEFAULT_FRAME_STYLE)
child = SimpleChildFrame(self)
if __name__ == '__main__':
app = wx.App()
frm = TopFrame(None)
frm.Show()
app.MainLoop()
Thank you.