Browse Source

example code didn't run

hansrwindhoff 9 years ago
parent
commit
69140af083
1 changed files with 4 additions and 2 deletions
  1. 4 2
      docs/api/screen.md

+ 4 - 2
docs/api/screen.md

@@ -37,8 +37,8 @@ app.on('ready', function() {
   var electronScreen = require('screen');
   var displays = electronScreen.getAllDisplays();
   var externalDisplay = null;
-  for (var i in displays) {
-    if (displays[i].bounds.x > 0 || displays[i].bounds.y > 0) {
+  for (var i =0; i< displays.length; i++) {
+    if (displays[i].bounds.x !==0 || displays[i].bounds.y !== 0) {
       externalDisplay = displays[i];
       break;
     }
@@ -48,6 +48,8 @@ app.on('ready', function() {
     mainWindow = new BrowserWindow({
       x: externalDisplay.bounds.x + 50,
       y: externalDisplay.bounds.y + 50,
+       width: 900,
+       height:600
     });
   }
 });