samedi 9 mai 2015

Showing window after it is fully loaded

When I create basic application and initialize it using electron command, it shows me a blank window and a moment later loads the content.

Which event and which object should be used to show the window after the content is fully loaded?

did-finish-load on a window.webContent object? Or maybe dom-ready? Or maybe something else?

app.js:

var app = require('app'),
    Window = require('browser-window'),
    mainWindow = null;

require('crash-reporter').start();

app.on('ready', function() {
   mainWindow = new Window({ width: 600, height: 400, show: false });

   mainWindow.loadUrl('file://' + __dirname + '/index.html');
   mainWindow.show();

   //
   // mainWindow.webContent.on('did-finish-load', function() {
   //     something like that is a proper way?
   // });
   //
});

Aucun commentaire:

Enregistrer un commentaire