setting menu items disabled ???

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Acki

setting menu items disabled ???

Post by Acki »

How can I set a menu item en-/disabled ???
I tried it like this, but that doesn't work:

Code: Select all

void cEditorGUI::setGUIEnabled(IrrlichtDevice* irrDev, bool enable){
  IGUIEnvironment* tmp = irrDev->getGUIEnvironment();
  IGUIElement* root = tmp->getRootGUIElement();
  IGUIContextMenu* e = (IGUIContextMenu*)root->getElementFromId(IDMenuMenu, true);
  IGUIContextMenu* submenu = e->getSubMenu(0);
  submenu->setItemEnabled(IDMenuProgEnde, enable);
}
All is working, but the last line...
I can set the sub menu (e) to enabled and disabled with e->setEnabled(bool), but I can't get it to work with the menu item!


thx, Acki
Post Reply