Advertisement
Guest User

Untitled

a guest
Oct 6th, 2015
1,244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var app = require('app');  // Module to control application life.
  2. var BrowserWindow = require('browser-window');  // Module to create native browser window.
  3.  
  4. // Report crashes to our server.
  5. require('crash-reporter').start();
  6.  
  7. // Keep a global reference of the window object, if you don't, the window will
  8. // be closed automatically when the JavaScript object is garbage collected.
  9. var mainWindow = null;
  10.  
  11. // Quit when all windows are closed.
  12. app.on('window-all-closed', function() {
  13.   // On OS X it is common for applications and their menu bar
  14.   // to stay active until the user quits explicitly with Cmd + Q
  15.   if (process.platform != 'darwin') {
  16.     app.quit();
  17.   }
  18. });
  19.  
  20. // This method will be called when Electron has finished
  21. // initialization and is ready to create browser windows.
  22. app.on('ready', function() {
  23.   // Create the browser window.
  24.   mainWindow = new BrowserWindow({width: 800, height: 600, transparent: true, frame: false});
  25.  
  26.   // and load the index.html of the app.
  27.   mainWindow.loadUrl('file://' + __dirname + '/index.html');
  28.  
  29.   // Open the DevTools.
  30.   // mainWindow.openDevTools();
  31.  
  32.   // Emitted when the window is closed.
  33.   mainWindow.on('closed', function() {
  34.     // Dereference the window object, usually you would store windows
  35.     // in an array if your app supports multi windows, this is the time
  36.     // when you should delete the corresponding element.
  37.     mainWindow = null;
  38.   });
  39. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement