I wish to implement a feature within my tool where, upon right-clicking, a context is selected, and then a secondary menu is displayed. I have seen this implementation in the relevant extensions of curic, but I do not understand how it was achieved.
The #getMenu method is called by SketchUp to let the tool provide its own context menu.
2 Likes
def getMenu(menu)
submenu = menu.add_submenu("Test")
submenu.add_item("sub test") {UI.messagebox('test', MB_OK)}
end
Sorry for not expressing it clearly. I meant that after right-clicking to bring up the context menu, clicking on any secondary menu item will then bring up another layer of a tertiary menu.
You can see the example how to do, after my post by @bobecka
You can add more item to to submenu as you like.
Also, the documentation linked has an example of adding what was right-clicked to the selection and conditionally adding a contextual menu item.