Hi I have created several widget extensions and all of them appear under View in menu bar, however I am trying to put few of my extensions under Custom submenu.
I already took a look at below thread, though it did help me to understand how to add new entry and submenu, the examples had built in command id which was used easily, but in my case I need to add the extension ids. How to add a new main menu on top?
I tried this by creating a menu bar extension which creates a submenu, and at the same path I try to add the action, but register.MenuAddAction was called in resptective widget extensions, this did add the submenu but the action below never pops up.
Could you please provide me your insights here?
Thanks in Advance
Nandish
@Nandish thank you for the discussion, I believe it should be quite easy.
In your MenuContribution you can create the menu-path you need, and build the menu as you see fit. In order to add the widgets you can register their toggleCommandId to the same menu path.
}
Note MyViewContribution is the extension which I am trying to display under MyMenu, however I do not see the action under My Menu, I can see My Menu at the top of menubar. Could you please let me know what am I doing wrong, in terms of registering menu action.
Hi, @vince-fugnitto, I could figure it out, I was not getting the correct CommandId at my menu contribution.
However, I get my widget name under my menu entry, would it be possible to have an alias for this, for example: label: MyExtensionWidget widget, instead of displaying this can I display, MyWidget1 under MyMenu and open MyExtensionWidget widget when clicked on MyWidget1?
You can take a look at the API when registering menus, but basically you can specify a custom label if you do not want to use the one attached to your commandId.
For example:
The command is registered with Close All Tabs but the menu entry uses a custom label of Close All.