How can I dynamically register the menu? #13716
Replies: 2 comments 2 replies
-
Hey @baoqing1124, Can you provide a reproducible example? We're performing dynamic registration of menu actions (see here for an example) all the time in the framework. It's supposed to work. |
Beta Was this translation helpful? Give feedback.
-
@baoqing1124, for now, you can see how the Arduino IDE solves this: https://github.com/arduino/arduino-ide/blob/aa9b10d68e6653b7f40ab920173c7964aaefbfa4/arduino-ide-extension/src/common/main-menu-manager.ts#L7 If you want to unregister submenus, there is a non-API way to do it: https://github.com/arduino/arduino-ide/blob/aa9b10d68e6653b7f40ab920173c7964aaefbfa4/arduino-ide-extension/src/browser/menu/arduino-menus.ts#L198 |
Beta Was this translation helpful? Give feedback.
-
I need to register the menu dynamically during the use of the application, but I have tested that the menu cannot be displayed when I register the menu asynchronously. What should I do to achieve this function? Can anyone help me?
Beta Was this translation helpful? Give feedback.
All reactions