[ wxwindows-Bugs-1538661 ] Creating menu items with NULL parent
SourceForge.net
noreply at sourceforge.net
Fri Aug 11 05:41:20 PDT 2006
Bugs item #1538661, was opened at 2006-08-11 14:41
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1538661&group_id=9863
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Common
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Christian Walther (cwalther)
Assigned to: Nobody/Anonymous (nobody)
Summary: Creating menu items with NULL parent
Initial Comment:
This code
wxMenuItem *item = new wxMenuItem(NULL, wxID_ANY,
wxT("item"));
triggers an assertion failure "menuitem should have a
menu" in wxMenuItemBase::wxMenuItemBase(...), whereas
wxMenu *menu = new wxMenu();
wxMenuItem *item = new wxMenuItem(menu, wxID_ANY,
wxT("item"));
item->SetMenu(NULL);
seems to be perfectly legal - it's even done in
wxWidgets itself by wxMenuItemBase::DoRemove(wxMenuItem
*item).
Which one is right? I hope the second, because creating
parent-less menu items for adding or not adding them to
some menu later is useful. In that case, that assertion
should be removed, so that the first form can be used
as well.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1538661&group_id=9863
More information about the wx-dev
mailing list