我的代码
def myCaller(self, event):
wx.CallAfter(self.msgbox(0.3434, 0.34, 0.121))
def msgbox(self, val, f1, f2):
message = "Node Failure Probability: %f \nLeft Child Value: %f \nRight Child Value: %f" % (val, f1, f2)
dlg = wx.MessageDialog(self, message, "Node Information", wx.OK)
dlg.showmodal()
dlg.Destroy()
输出正常,但随后在 Shell 中出现错误:
dlg.ShowModal()
File "C:\Python27\lib\site-packages\wx-2.8-msw-unicode\wx\_windows.py", line 711, in ShowModal
return _windows_.Dialog_ShowModal(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "wxAssertFailure" failed at ..\..\src\common\wincmn.cpp(2571) in DoNotifyWindowAboutCaptureLost(): window that captured the mouse didn't process wxEVT_MOUSE_CAPTURE_LOST
我哪里错了?提前致谢!