-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.js
53 lines (46 loc) · 1018 Bytes
/
init.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
const {remote} = require('electron');
const {Menu} = remote;
var onPrefsClicked1 = function() {
alert('You clicked Prefs-1');
}
var onPrefsClicked2 = function() {
alert('You clicked Prefs-2');
}
var onPrefsClicked3 = function() {
alert('You clicked Prefs-3');
}
// define template
const template = [
{
label: ''
// label: 'Electron-1',
// submenu: [
// {
// label: 'Prefs-1',
// click: function() {
// onPrefsClicked1();
// },
// accelerator: process.platform === 'darwin' ? 'Alt+Command+I' : 'Ctrl+Shift+I'
// }
// ]
// },
// {
// label: 'Electron-2',
// submenu: [
// {
// label: 'Prefs-2',
// click: function() {
// onPrefsClicked2();
// }
// },
// {
// label: 'Prefs-3',
// click: function() {
// onPrefsClicked3();
// }
// }
// ]
}
];
const menu = Menu.buildFromTemplate(template);
Menu.setApplicationMenu(menu);