[wxPython-dev] MenuItem problem on Windows wxPython 2.8

Robin Dunn robin at alldunn.com
Wed Jan 10 13:59:51 PST 2007


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.

-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!





More information about the wxpython-dev mailing list