|
⇤ ← Revision 1 as of 2023-01-08 17:42:47
Size: 630
Comment:
|
Size: 636
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 42: | Line 42: |
Electron Menu
Contents
Usage
const { app, BrowserWindow, menu, shell } = require("electron");
const template = [
{
label: 'File',
submenu: [
{
label: 'Exit',
click() {
app.quit()
}
}
]
},
{
label: 'Help',
submenu: [
{
label: 'Learn More',
click: async () => {
await shell.openExternal('https://example.org');
}
}
]
}
];
const menu = Menu.buildFromTemplate(template);
Menu.setApplicationMenu(menu);