Hello,
Anybody knows if it’s possible to add a new top menu item like that:
Tanks.
Hello,
Anybody knows if it’s possible to add a new top menu item like that:
Tanks.
Yes, Metahopper and Pancake have menus there.
You can access Grasshopper.Instances.DocumentEditor and iterate over its controls. Do note that plug-ins are often loaded before the editor window is instantiated.
Thanks, it worked fine!
I’m trying to change the colors and it’s ok for regular winforms or inherited components, but I have problems to change it for the tabs:
I realized that the GH_RibbonTab
is rendered by GH_RibbonPainter
inside of Gh_RibbonTab
but its using SystemColors.WindowText
.
Is there a change to pass the color from outside?
Thanks
no worries I’ll set them by reflection
I’m trying to add an extra menu to the grasshopper main menu.
The problem I’m running into is that the menu doesn’t appear in grasshopper.
My sample code:
MenuItem newMenuItem = new MenuItem();
newMenuItem.Text = "Name";
newMenuItem.MenuItems.AddRange(new MenuItem[]
{
new MenuItem()
{
Text = "Save/Close",
},
});
MainMenu grasshopperMainMenu = Grasshopper.Instances.DocumentEditor.Menu.GetMainMenu();
grasshopperMainMenu.MenuItems.Add(newMenuItem);
The code is placed in the constructor (GH_AssemblyInfo base class). I read that you mentioned that plugins are usually loaded before the editor is instantiated.
Where can I best place this code, so that the menu item is visible in grasshopper?