Skip to content

Instantly share code, notes, and snippets.

@chilismaug
Created July 9, 2016 02:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chilismaug/52758589d5349d88cf714dbfee6c6735 to your computer and use it in GitHub Desktop.
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
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