user2554585
user2554585

Reputation: 3679

Node-Webkit Tray on click bring window to front

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

Answers (1)

Chuks
Chuks

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

Related Questions