You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var gui = require('nw.gui');
gui.Window.get().showDevTools();
//menubar stuff- needs osx as well
var your_menu = new nw.Menu({ type: 'menubar' });
if(process.platform == "darwin"){
your_menu.createMacBuiltin("Crocotile3D"); //I need to change some values in files for mac to this name instead of nwjs
your_menu.removeAt(0);
your_menu.removeAt(0);
}
var strArray = ['a','shift'];
var loadItem = new nw.MenuItem({ label: 'Load Scene', key: strArray[0], modifiers: strArray[1], click: function() { test(); } });
var fileSubmenu = new nw.Menu();
fileSubmenu.append(loadItem);
// the menu item appended should have a submenu
your_menu.append(new nw.MenuItem({ label: 'File', submenu: fileSubmenu, click: function(){ } }));
gui.Window.get().menu = your_menu;
function test(){
console.log("selected menu item");
}
The text was updated successfully, but these errors were encountered:
Issue Type
Bug Report.
MenuItem click functions do not work in 0.94.0
Additional Info
The text was updated successfully, but these errors were encountered: