2005年02月02日 星期三 07:20
以下是输出: Traceback (most recent call last): File "D:\work\feednow\RssTree.py", line 291, in OnSelChanged index, itemType, prefix = self.tree.GetPyData(item) File "C:\Python24\Lib\site-packages\wx-2.5.3-msw-unicode\wx\_controls.py", line 5137, in GetItemPyData return _controls_.TreeCtrl_GetItemPyData(*args, **kwargs) wx._core.PyAssertionError: C++ assertion "wxAssertFailure" failed in ..\..\src\msw\treectrl.cpp(1166): invalid tree item 这是在OnSelChanged中对应的代码: item = event.GetItem() index, itemType, prefix = self.tree.GetPyData(item) 为什么会出现这种问题呢
2005年02月02日 星期三 08:12
item是否是有效项? DreamY 写道: > 以下是输出: > > Traceback (most recent call last): > File "D:\work\feednow\RssTree.py", line 291, in OnSelChanged > index, itemType, prefix = self.tree.GetPyData(item) > File > "C:\Python24\Lib\site-packages\wx-2.5.3-msw-unicode\wx\_controls.py", > line 5137, in GetItemPyData > return _controls_.TreeCtrl_GetItemPyData(*args, **kwargs) > wx._core.PyAssertionError: C++ assertion "wxAssertFailure" failed in > ..\..\src\msw\treectrl.cpp(1166): invalid tree item > > 这是在OnSelChanged中对应的代码: > item = event.GetItem() > index, itemType, prefix = self.tree.GetPyData(item) > > 为什么会出现这种问题呢 > > _______________________________________________ > python-chinese list > python-chinese at lists.python.cn > http://python.cn/mailman/listinfo/python-chinese > >
2005年02月02日 星期三 18:22
是的,只是在OnSelChanged这个函数里面有问题,其他的如OnLeftClick等都是正 确的。 而且,OnSelChanged也能正常的完成任务。 0.706 写道: >item是否是有效项? > >DreamY 写道: > > >>以下是输出: >> >>Traceback (most recent call last): >>File "D:\work\feednow\RssTree.py", line 291, in OnSelChanged >>index, itemType, prefix = self.tree.GetPyData(item) >>File >>"C:\Python24\Lib\site-packages\wx-2.5.3-msw-unicode\wx\_controls.py", >>line 5137, in GetItemPyData >>return _controls_.TreeCtrl_GetItemPyData(*args, **kwargs) >>wx._core.PyAssertionError: C++ assertion "wxAssertFailure" failed in >>..\..\src\msw\treectrl.cpp(1166): invalid tree item >> >>这是在OnSelChanged中对应的代码: >>item = event.GetItem() >>index, itemType, prefix = self.tree.GetPyData(item) >> >>为什么会出现这种问题呢 >> >>_______________________________________________ >>python-chinese list >>python-chinese at lists.python.cn >>http://python.cn/mailman/listinfo/python-chinese >> >> >> >> > >_______________________________________________ >python-chinese list >python-chinese at lists.python.cn >http://python.cn/mailman/listinfo/python-chinese > > > >
Zeuux © 2025
京ICP备05028076号