Menus
Dynamically Editing the Application Menu
The Application menu lives at the top of the screen on Mac. On Windows, you can find it under your app window's title bar. You can dynamically add items to this menu using our Application Menu API.
This API is in beta and may change (or be completely removed) without warning.
Add a menu item to the application menu
You can use appMenu.add
from @todesktop/client-core
to easily add custom items to the application menu that control your application.
The items you add to the application menu will not appear on the UI until you call appMenu.refresh().
Refresh the application menu to reflect any changes
When you add a menu item to the menubar, it does not immediately appear in the application menu. You need to call refresh()
to update the menu that is displayed on the UI.
If you are adding multiple items to the application menu then it is best to only call refresh()
after you have added all of the necessary items to the application menu.