Created
July 9, 2016 02:48
-
-
Save chilismaug/52758589d5349d88cf714dbfee6c6735 to your computer and use it in GitHub Desktop.
improved main for kyle's multi-window electron youtute - he has app.js and main.js reversed as to std electron style
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var remote = require('remote') | |
var ipc = require('ipc') | |
var Menu = remote.require('menu') | |
var menu = Menu.buildFromTemplate([ | |
{ | |
label: 'Electron', | |
submenu: [ | |
{ | |
label: 'Prefs', | |
click: function () { | |
ipc.send('toggle-prefs') | |
} | |
}, { | |
type: 'separator' | |
}, { | |
label: 'Quit', | |
accelerator: 'Command+Q', | |
click: function () { | |
remote.require('app').quit() | |
} | |
} | |
] | |
} | |
]) | |
Menu.setApplicationMenu(menu) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment