First you need to prevent app appear in taskbar
{
"name": "My App",
"version": "1.0.0",
"main": "app.html",
"window": {
"show": false,
"show_in_taskbar": false
}
}
Then you need to create tray (top bar) menu: (example from his source)
tray = new app.node.gui.Tray({
title: '',
icon: 'assets/css/images/menu_icon.png',
alticon: 'assets/css/images/menu_alticon.png',
iconsAreTemplates: false
});
Then need create hidden window and show it on click in tray:
// create window
var params = {toolbar: app.devMode, frame: false, transparent: true, resizable: false, show: false};
window = app.node.gui.Window.open('templates/panel.html', params);
function showPopup (x, y) {
window.on('document-end', function()
window.moveTo(x - (window.window.width / 2) - 6, y);
window.show();
window.focus();
});
}
// show panel when click in tray
tray.on('click', function (evt) {
showPopup(evt.x, evt.y);
});
click
event for theTray
in OS X doesn't fire, it does in Windows and Linux though. As has been discussed in this issue. github.com/nwjs/nw.js/issues/1874#issuecomment-67249147 – Girhiny