How can I open the tray menu by left-click?
By default the menu opened up by hitting right-click.
CODE:
// Load native UI library
var gui = require('nw.gui');
// Create a tray icon
var tray = new gui.Tray({
title: 'Tray',
icon: 'img/icon.png',
click: function(){
// Open tray menu here!!
console.log('READY!!!');
}
});
// Give it a menu
var menu = new gui.Menu();
menu.append(new gui.MenuItem({ type: 'checkbox', label: 'box1' }));
tray.menu = menu;