allow calling SetItemLabel() for menu items with NULL menu parent too
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58578 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
4a3c54bfa5
commit
3350ab0cf2
@ -365,6 +365,9 @@ void wxMenuItem::SetItemLabel(const wxString& txt)
|
||||
|
||||
// the item can be not attached to any menu yet and SetItemLabel() is still
|
||||
// valid to call in this case and should do nothing else
|
||||
if ( !m_parentMenu )
|
||||
return;
|
||||
|
||||
const UINT id = GetMSWId();
|
||||
HMENU hMenu = GetHMenuOf(m_parentMenu);
|
||||
if ( !hMenu || ::GetMenuState(hMenu, id, MF_BYCOMMAND) == (UINT)-1 )
|
||||
|
Loading…
Reference in New Issue
Block a user