electron/browser/default_app/main.js

26 lines
645 B
JavaScript
Raw Normal View History

2013-04-15 07:39:54 +00:00
var atom = require('atom');
var ipc = require('ipc');
var Window = require('window');
var mainWindow = null;
2013-04-15 07:39:54 +00:00
// Echo every message back.
ipc.on('message', function(process_id, routing_id) {
ipc.send.apply(ipc, arguments);
});
2013-04-23 13:52:19 +00:00
ipc.on('sync-message', function(event, process_id, routing_id) {
event.result = arguments;
});
2013-04-15 07:39:54 +00:00
atom.browserMainParts.preMainMessageLoopRun = function() {
mainWindow = new Window({ width: 800, height: 600 });
2013-04-18 16:06:10 +00:00
mainWindow.url = 'file://' + __dirname + '/index.html';
mainWindow.on('page-title-updated', function(event, title) {
event.preventDefault();
this.title = 'Atom Shell - ' + title;
});
2013-04-15 07:39:54 +00:00
}