问题
I'm new to node-webkit and have the tray created as such
var gui = require('nw.gui');
var tray = new gui.Tray({ icon: 'images/Appicon.png' });
tray.on('click', function() { console.log("what goes in here?")});
When the tray icon is clicked I want the window to be pulled up if it's minimized and open index.html. Right now I get the log statement to print.
回答1:
Try this
var gui = require('nw.gui');
var win = gui.Window.get();
var tray = new gui.Tray({
icon: 'images/Appicon.png'
});
tray.on('click', function() {
win.maximize();
});
来源:https://stackoverflow.com/questions/26132365/node-webkit-tray-on-click-bring-window-to-front