Resize event

5 views
Skip to first unread message

w00...@gmail.com

unread,
Mar 26, 2013, 1:41:24 PM3/26/13
to node-...@googlegroups.com
Hello all,
It appears there isn't a way to capture resize events through Window, at least standing to the Wiki Documentation. I'm opening new windows that point to remote URLs and would like to be able to detect when the window get resized.

Am I missing something or is this not implemented?

Chaobin Zhang

unread,
Mar 26, 2013, 9:10:55 PM3/26/13
to node-...@googlegroups.com
Hi, 

Current our native ui didn't have the resize event. But you can use the window.onresize event. 
For your reference: http://www.w3schools.com/jsref/event_onresize.asp

HTH
@zhchbin Chaobin Zhang


--
You received this message because you are subscribed to the Google Groups "node-webkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-webkit...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
  

w00...@gmail.com

unread,
Mar 27, 2013, 2:17:15 AM3/27/13
to node-...@googlegroups.com
This is not possible if you open a remote URL though, is it?

var win = gui.Window.open('http://github.com');

Chaobin Zhang

unread,
Mar 27, 2013, 6:15:49 AM3/27/13
to node-...@googlegroups.com
Not, I can get the window DOM object via the Window.window. Following code is the workaround:
<script>
      var gui = require('nw.gui');
      var win = gui.Window.open('http://github.com');
      win.on('loaded', function() {
        win.window.onresize = function() {
          console.log("test");
        }     
      });
</script>
Reply all
Reply to author
Forward
0 new messages