}
void App::OnFinishLaunching() {
- Emit("finish-launching");
+ Emit("ready");
}
// static
setBadge: bindings.dockSetBadgeText
getBadge: bindings.dockGetBadgeText
+# Support old event name.
+app.once 'ready', -> app.emit 'finish-launching'
+
# Only one App object pemitted.
module.exports = app
dialog.showMessageBox({message: url, buttons: ['OK']});
});
-app.on('finish-launching', function() {
+app.on('ready', function() {
app.commandLine.appendSwitch('js-flags', '--harmony_collections');
mainWindow = new BrowserWindow({ width: 800, height: 600 });
## Event: will-finish-launching
-Setup crash reporter and auto updater here.
+Emitted when application has done basic startup. On Windows and Linux it is the
+same with `ready` event, on OS X this event represents the
+`applicationWillFinishLaunching` message of `NSApplication`, usually you would
+setup listeners to `open-file` and `open-url` events here, and start the crash
+reporter and auto updater.
-## Event: finish-launching
+Under most cases you should just do everything in `ready` event.
-Do final startup like creating browser window here.
+## Event: ready
+
+Emitted when atom-shell has done everything initializaiton.
## Event: window-all-closed
// This method will be called when atom-shell has done everything
// initialization and ready for creating browser windows.
-app.on('finish-launching', function() {
+app.on('ready', function() {
// Create the browser window,
mainWindow = new Window({ width: 800, height: 600 });
// and load the index.html of the app.
app.terminate();
});
-app.on('finish-launching', function() {
+app.on('ready', function() {
var template = [
{
label: 'Atom',