-
Notifications
You must be signed in to change notification settings - Fork 15k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Menu Items #937
Comments
You can not bind the same accelerator to two menu items, for your case a To set enable/disable a menu item, you can simply set var template = [
{
label: 'Atom',
submenu: [
{
label: 'Quit',
accelerator: 'Command+Q',
click: function() { app.quit(); }
},
]
},
{
label: 'View',
submenu: [
{
label: 'Item',
}
]
},
];
menu = Menu.buildFromTemplate(template);
Menu.setApplicationMenu(menu);
menu.items[1].submenu.items[0].enabled = false; You can also change the But you can not add/remove menu items dynamically (#846) or bind menu item's state to a variable automatically (#528) for now. |
Can someone add the "menu" label to this issue. It would have helped me find it earlier. Thanks |
How can one change a menu item label? |
See #4097 I can't change |
How can I update a Menu Item depending on an event?
For example I have two items for entering and leaving fullscreen:
But I want to hide and show them depending if I'm fullscreen or not.
My idea was to create a menu for each state and then change the whole menu like:
But this seems really bad and I'm not sure if you can change the Application Menu afterwards...
Plus I want to be able to enable and disable certain menu items depending on other events and context... is their a way to handle this?
The text was updated successfully, but these errors were encountered: