Preserve window state example doesn't work

2 views
Skip to first unread message

Shinichi Katayama

unread,
Dec 9, 2012, 8:33:26 PM12/9/12
to node-...@googlegroups.com
Hi,

I tried "Preserve window state between sessions" example (https://github.com/rogerwang/node-webkit/wiki/Preserve-window-state-between-sessions),
but window position and size couldn't be restored.
I tested with v0.3.5 on Mac Lion and Windows 7 but it didn't work on both environments.

I checked that values were saved on localStorage properly so I think there's a problem in resizeTo and moveTo.
Does this example work on v0.3.5?

Cheng Zhao

unread,
Dec 11, 2012, 8:56:41 PM12/11/12
to node-...@googlegroups.com
Numbers stored in localStorage were converted to string, so in v0.3.5
you should do:
win.resizeTo(Number(localStorage.width), Number(localStorage.height));

v0.3.6 will automatically do the conversion for you.

Shinichi Katayama

unread,
Dec 11, 2012, 11:26:42 PM12/11/12
to node-...@googlegroups.com
Thanks!
Now it works well!
Reply all
Reply to author
Forward
0 new messages