-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
executable file
·42 lines (33 loc) · 1.08 KB
/
main.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
var menubar = require('menubar');
const electron = require('electron');
const Menu = electron.Menu;
const dialog = electron.dialog;
const path = require('path');
var mb = menubar({
width: 400,
height: 800,
//preloadWindow: true
});
mb.on('ready', function ready () {
console.log('app is ready');
const contextMenu = Menu.buildFromTemplate ([
{label: 'Info', click: () => { dialog.showMessageBox({
type: 'info',
buttons: ['OK'],
icon: path.join(__dirname, 'icons', 'todo_dock.png'),
//title: 'menuDO',
message: 'menuDo\n\nA electron menubar wrapper for todo.microsoft.com'+'!'
});
}},
//{label: 'Refresh', click: () => {mb.app.reload ();}},
{type: 'separator'},
{label: 'Quit', click: () => {mb.app.quit ();}}
])
this.tray.on ('right-click', () => {
mb.tray.popUpContextMenu (contextMenu);
})
});
mb.on('after-create-window', function loaded () {
console.log('window created');
//mb.window.openDevTools();
});