[wxPython-dev] MenuItem problem on Windows wxPython 2.8

Paul McNett p at ulmcnett.com
Fri Jan 12 10:46:05 PST 2007


Robin Dunn wrote:
> Paul McNett wrote:
>> We are getting this on Windows, but not on Linux, when instantiating a 
>> wx.MenuItem.
>>
> 
>>   File "C:\Python24\Lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", 
>> line 11047, in __init__
>>     _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs))
>> wx._core.PyAssertionError: C++ assertion "wxAssertFailure" failed at 
>> ..\..\src\common\stockitem.cpp(166) in wxGetStockLa
>> bel(): invalid stock item ID
>>
>> Worked fine in 2.6. The arguments being sent to the wx.MenuItem 
>> constructor are:
>> {'kind': 0, 'id': 5108, 'parentMenu': 
>> <dabo.ui.uiwx.dBaseMenuBar.FileMenu; proxy of <Swig Object of type 
>> 'wxMenu *' at 0x20f8eb0> >}
>>
>> Any ideas?
> 
> wx.ID_DEFAULT is not listed in the code that translates from a stock ID 
> to a label string.  I'm not sure if it is supposed to be, but for now 
> you can just not support using that ID.

I don't know what is going on. I've experimented using id's of -1, 
wx.NewId(), wx.ID_EXIT, or even not passing the id. In each case, I get 
the same assertion referring to an invalid stockitemid. However, I 
haven't been able to repro this using raw wx code, so something else is 
going on (probably in Dabo) that I need to track down. Why would this 
assert in Windows and not Linux?

-- 
pkm ~ http://paulmcnett.com





More information about the wxpython-dev mailing list