How do you set a submenu to a menu item.
I set the hasSubMenu flag to true, but MenuItem returns an index to the item, not a pointer to the element.
So, how do I attach a IGUIContextMenu to the MenuItem?
GUI Elements - Setting a submenu
GUI Elements - Setting a submenu
Crud, how do I do this again?
How exactly is this supposed to work? Im using this code:
getSubMenu is always returning 0
Code: Select all
mainmenu = world->guienv->addMenu();
s32 m1 = mainmenu->addItem(L"New");
s32 m2 = mainmenu->addItem(L"Load");
if (!mainmenu->getSubMenu(m1))
{
printf("Failed to load submenu\n");
return;
}
IGUIContextMenu *tmp = mainmenu->getSubMenu(m1);
tmp->addItem(L"omgz0r");
.: http://www.mercior.com :.
Nevermind, I found that I needed to set the hasSubMenu flag
Another question though - how do you add menu items using a char array for the text? I tried addItem((wchar_t*)text) but it always comes out blank
Another question though - how do you add menu items using a char array for the text? I tried addItem((wchar_t*)text) but it always comes out blank
.: http://www.mercior.com :.
You could try and use
Code: Select all
core::stringw text = yourCharText;
addItem(text.c_str());