-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmain.js
executable file
·29 lines (26 loc) · 1.18 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
var app = require('electron').app;
var Menu = require('electron').Menu;
var menubar = require('menubar');
var mb = menubar({width: 370, height: 210, preloadWindow:true, icon: __dirname+'/img/icon/icon.png'});
mb.on('ready', function ready () {
var template = [{
label: "Application",
submenu: [
{ label: "About Application", selector: "orderFrontStandardAboutPanel:" },
{ type: "separator" },
{ label: "Quit", accelerator: "Command+Q", click: function() { app.quit(); }}
]}, {
label: "Edit",
submenu: [
{ label: "Undo", accelerator: "CmdOrCtrl+Z", selector: "undo:" },
{ label: "Redo", accelerator: "Shift+CmdOrCtrl+Z", selector: "redo:" },
{ type: "separator" },
{ label: "Cut", accelerator: "CmdOrCtrl+X", selector: "cut:" },
{ label: "Copy", accelerator: "CmdOrCtrl+C", selector: "copy:" },
{ label: "Paste", accelerator: "CmdOrCtrl+V", selector: "paste:" },
{ label: "Select All", accelerator: "CmdOrCtrl+A", selector: "selectAll:" }
]}
];
// mb.window.openDevTools(); //uncomment to view dev tools
Menu.setApplicationMenu(Menu.buildFromTemplate(template));
})