the electronic application is open with the same default menu that appears in the application of the example of quick launch of e-mail, and I do not know how to change it. I also tried the example menu in the docs , but nothing has changed. when I hide the menu with mainWindow.setMenu(null); , the menu is gone, but I still can not start a new menu
any ideas?
Platform
: windows 7
electron ver: 0.36.4
ref files:
package.json:
{ "name": "electric_timer", "version": "0.1.0", "description": "a Time sheet & project managment", "main": "app.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { "type": "git", "url": "none" }, "author": "Eyal Ron", "license": "MIT" }
app.js:
var app = require('app'); var BrowserWindow = require('browser-window'); app.on('ready', function (){ var mainWindow = new BrowserWindow({ width: 800, height: 600 }); mainWindow.setMenu(null); mainWindow.loadUrl('file://' + __dirname + '/main.html'); });
main.js:
var remote = require('remote'); var Menu = remote.require('menu'); var menu = Menu.buildFromTemplate([ { label: 'Electron', submenu: [ { label: 'Prefs', click: function(){ alert('hello menu'); } } ] } ]); Menu.setApplicationMenu(menu);
main.html:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>electron test</title> </head> <body> <h1>hello world</h1> <script>requier('./main.js')</script> </body> </html>
menu electron
Eyal ron
source share