Skip to content

Commit

Permalink
Added edit menu for copy past
Browse files Browse the repository at this point in the history
  • Loading branch information
vanevery committed Oct 4, 2016
1 parent e00d626 commit 05044e4
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ const electron = require('electron');
const app = electron.app; // Module to control application life.
const BrowserWindow = electron.BrowserWindow; // Module to create native browser window.

const {Menu} = require('electron')

// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
var mainWindow = null;
Expand Down Expand Up @@ -32,6 +34,21 @@ app.on('ready', function() {
// when you should delete the corresponding element.
mainWindow = null;
});

var template = [{
label: "Application",
submenu: [
{ label: "Quit", accelerator: "Command+Q", click: function() { app.quit(); }}
]}, {
label: "Edit",
submenu: [
{ label: "Copy", accelerator: "CmdOrCtrl+C", selector: "copy:" },
{ label: "Paste", accelerator: "CmdOrCtrl+V", selector: "paste:" },
{ label: "Select All", accelerator: "CmdOrCtrl+A", selector: "selectAll:" }
]}
];

Menu.setApplicationMenu(Menu.buildFromTemplate(template));
});


Expand Down

0 comments on commit 05044e4

Please sign in to comment.