Custom component GUI - component menu item expand on mouse hover

Hi,

on a custom component, I am trying to add an item to the component menu (right-click). I use the Menu_Append… functions as advised in the GH SDK.

Now I am trying to add an item which behaves exactly like the “Runtime warnings” item. I would like it to have a little triangle on the right, and to expand and display a second list when the mouse hovers over it. Like “runtime warnings”, the second list should then have clickable items

Is there a Function akin to the Menu_Append… functions which I can draw on for this behaviour or will I have to engineer it myself using the menu.MouseHover event etc.
However, to replicate the exact functionality and look, maybe this type of element could be exposed in a Menu_Append… function? Or even better, @DavidRutten, would you share a relevant code snippet?

Many thanks!

Daniel

expand
it is the behaviour of “Runtime warnings” I am trying to replicate, except with different content.

Something along these lines. The Menu_AppendItem() method returns the item it creates, and as soon as you start appending more items to that item dropdown list, you’ll get submenus.

var item = Menu_AppendItem(menu, "Top Level Name", ...);
Menu_AppendItem(item.DropDown, "First name", ...);
Menu_AppendItem(item.DropDown, "Second name", ...);
1 Like

Clever. And so simple! Works like a charm. Many thanks!