I am trying to create a menu for a mac node-webkit app. I am trying to append a preferences menu item to the first/root menu(app name > about, preferences, etc). I have not been able to figure out how to access the menus that the .createMacBuiltin(); function creates. I have only been able to create a new custom menu. Has anyone figured out how to do this. See Slack's mac app for an example. Here is my code so far.
var gui = require('nw.gui');
// Create menu container
var Menu = new gui.Menu({
type: 'menubar'
});
Menu.createMacBuiltin("Example App");
Menu.append(
new gui.MenuItem({
label: 'Preferences',
click : function () {
$('#preferences').modal('toggle');
}
})
);
gui.Window.get().menu = Menu;
Thanks for the help.