起初我的运行系统:
我使用Windows 8 Pro和Mayavi 4.3从存储库与wxPython 2.9.4.0在Python 2.7.4,但也有同样的问题Mayavi 4.2.1从EPD包…
当我试图将mayavi嵌入到笔记本面板时,我得到了一些UI问题。即使在mayavi的演示文件中,我也得到了mayavi生成的外部帧的相同奇怪行为。
使用设置按钮,设置窗口打开。此外,场景对我使用设置更改的参数做出反应。但点击确定或取消后,窗口不会关闭。python会返回几个错误消息。当我通过实现mlab.show_pipeline()命令使用管道时,也有类似的行为。
这种行为也可以在enthought网页的示例中找到。
在这里你可以看到我的错误信息后,试图点击确定在设置框架的第一个例子:
C:my_directory>python wx_embedding.py
C:Python27libsite-packagesenthougth_development_mayavi_gittraitsuitraitsuiwxtoolkit.py:35: wxPyDeprecationWarning: Using deprecated class PySimpleApp.
_app = wx.PySimpleApp()
wx_embedding.py:63: wxPyDeprecationWarning: Using deprecated class PySimpleApp.
app = wx.PySimpleApp()
Traceback (most recent call last): File "C:Python27libsite-packagesenthougth_development_mayavi_gittraitsuitraitsuiwxui_live.py", line 360, in _on_ok
self.close( wx.ID_OK )
File "C:Python27libsite-packagesenthougth_development_mayavi_gittraitsuitraitsuiwxui_live.py", line 320, in close
ui.finish()
File "C:Python27libsite-packagesenthougth_development_mayavi_gittraitsuitraitsuiui.py", line 264, in finish
self.reset( destroy = True )
File "C:Python27libsite-packagesenthougth_development_mayavi_gittraitsuitraitsuiui.py", line 304, in reset
editor.dispose()
File "C:Python27libsite-packagesenthougth_development_mayavi_gittraitsuitraitsuiwxinstance_editor.py", line 208, in dispose
self._ui.dispose()
File "C:Python27libsite-packagesenthougth_development_mayavi_gittraitsuitraitsuiui.py", line 237, in dispose
self.finish()
File "C:Python27libsite-packagesenthougth_development_mayavi_gittraitsuitraitsuiui.py", line 264, in finish
self.reset( destroy = True )
File "C:Python27libsite-packagesenthougth_development_mayavi_gittraitsuitraitsuiui.py", line 318, in reset
toolkit().destroy_children( self.control )
File "C:Python27libsite-packagesenthougth_development_mayavi_gittraitsuitraitsuiwxtoolkit.py", line 474, in destroy_children
control.DestroyChildren()
File "C:Python27libsite-packageswx-2.9.4-mswwx_core.py", line 9203, in DestroyChildren
return _core_.Window_DestroyChildren(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "GetEventHandler() == this" failed at . ...srccommonwincmn.cpp(468) in wxWindowBase::~wxWindowBase(): any pushed event handlers must have been removed
Thanks in advance
Mayvi与wx 2.9不兼容。
更多信息在这里:https://support.enthought.com/entries/22601196-wxPython
请使用enpkg恢复到随EPD发货的wx2.8。
至少这个特殊的异常可以通过与此PR相关的更改来解决:https://github.com/enthought/traitsui/pull/108。我还不知道Mayavi和堆栈的其他部分,但这个变化至少会让wxPython 2.9的特性变得更好。