Skip to main content
DrDaveJ
Inspiring
August 25, 2015
Question

RemoveMenu, not working

  • August 25, 2015
  • 0 replies
  • 243 views

Whether I AutoRun at startup, or wait and run manually when needed,

I add a menu to the main menu bar with this:

//Create menu

var myMenu = DefineMenu("Daves_ScriptingMenu", "Dave's Scripts");

//Get the main FM document menu, so we can

//add our custom menu, then add it.

var fmMenu = app.GetNamedMenu ("!MakerMainMenu");

fmMenu.AddMenuToMenu (myMenu);

. . . I add commands, etc. that are working.

The problem is removing the menu when I don't want it there.

I'm trying this code. It appears to run, but nothing happens. And there are no

messages generated in the Console.

Notice I tried using the menu name as well as its label.

//Get the main FM document menu, and then remove custom menu.

var fmMenu = app.GetNamedMenu ("!MakerMainMenu");

//Using Label

RemoveMenu(fmMenu, "Dave's Scripts");

//Using Name

//RemoveMenu(fmMenu, "Daves_ScriptingMenu");

UpdateMenus();

Can I get a hint as to what's up here?

Thanks,

Dave

This topic has been closed for replies.