Is there any simple way to align window of Node-Webkit application? As far as I can see in documentation there is such metod as Window.moveTo(), as well as property "position", which nevertheless could have only 3 values: "center", "mouse" and null. So in order to align the app by the right side of monitor I need to move window manually from code on start, or are there any other way?
Use javascript
window.screen.availHeight and window.screen.availWidth (which excludes window decorations n toolbar)
or
window.screen.height and window.screen.width (which includes window decorations n toolbar) to get the screen resolution.
In node-webkit package.json set
"window": { "show": false } this will hide the node-webkit window initially.
var appWidth = 400; // width of your application
Use window.moveTo(window.screen.availWidth - appWidth, 40);
Use window.show(); to show the window
this allows to place window anywhere on screen
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With