Skip to main content
gamedev.net
🔒 Locked

MAX plugin menu problem

Started by jcabeleira 0 replies 700+ views
Original Post
jcabeleira
jcabeleira
Hello, I'm writting an utility plugin for max but I'm having troubles inserting a sub-menu on MAX's main menu bar. I've managed to place there an item wich contains the sub-menu I want to display, currently the MAX menu bar it looks something like this: ----------------------------------------- File Edit (other default items) Voltaico ----------------------------------------- where "Voltaico" is the name of my option. But when I click that item, the sub-menu doesn´t opens. The code I'm using to create the menu is this:


ip= GetCOREInterface();
IMenuManager	*menuManager= ip->GetMenuManager();
IMenu			*mainMenu= menuManager->GetMainMenuBar();


IMenu *menu= GetIMenu();
menu->SetTitle("Voltaico");
menuManager->RegisterMenu(menu);

IMenuItem *item1= GetIMenuItem();
item1->SetTitle("Export static object");
menu->AddItem(item1);
		
IMenuItem *item2= GetIMenuItem();
item2->SetTitle("Export skinned object");
menu->AddItem(item2);

IMenuItem *mainItem= GetIMenuItem();
mainItem->SetSubMenu(menu);

//Add the new menu to the main menu.
mainMenu->AddItem(mainItem);
menuManager->UpdateMenuBar();

What am I doing wrong?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.