Reputation: 3679
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.
Upvotes: 1
Views: 665
Reputation: 1174
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();
});
Upvotes: 1