nw.js icon indicating copy to clipboard operation
nw.js copied to clipboard

Minimize event

Open albarin opened this issue 14 years ago • 6 comments

Hello, I'm new at node and node-webkit. I am starting to develop a little app and can't make the minimize event work. I have tried this code from the wiki: (https://github.com/rogerwang/node-webkit/wiki/Window)

// Load native UI library
var gui = require('nw.gui');

// Get the current window
var win = gui.Window.get();

// Listen to the minimize event
win.on('minimize', function() {
  console.log('Window is minimized');
});

// Minimize the window
win.minimize();

But the event "minimize" is never triggered and the message 'Window is minimized' is not printed. I don't now what I'm doing wrong, I would appreciate any help.

Thanks!!

albarin avatar Nov 22 '12 18:11 albarin

What's your OS?

zcbenz avatar Nov 23 '12 02:11 zcbenz

Ubuntu 12.10 64 bits

albarin avatar Nov 23 '12 08:11 albarin

I met this problem too. I use the sample codes in the Wiki and try to make the window minimize to tray, but they would not work. The event 'minimize' seemed didn't triggered. My OS is Ubuntu 12.04 , 64 bits.

JokerQyou avatar Nov 25 '12 10:11 JokerQyou

I found that if I added win.show() just after declaring win it works, but that might just be me.

samontea avatar Mar 03 '13 21:03 samontea

My workaround has landed on Chromium trunk. I put it here for reference if someone want to fix this issue. Code Review of Chromium.

zhchbin avatar Jul 23 '13 02:07 zhchbin

Please feel free to reopen it if you need it to be fixed again.

rogerwang avatar Dec 09 '13 00:12 rogerwang