Advertisement
Guest User

main.js

a guest
Nov 21st, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'use strict';
  2. const electron = require('electron')
  3. const app = electron.app
  4.  
  5. const path = require('path')
  6. const url = require('url')
  7.  
  8. let mainWindow
  9.  
  10. function createWindow () {
  11.   mainWindow = new electron.BrowserWindow({width: 1366, height: 768})
  12.   mainWindow.loadURL(url.format({
  13.     pathname: path.join(__dirname, 'index.html'),
  14.     protocol: 'file:',
  15.     slashes: true
  16.   }))
  17.  
  18.   mainWindow.on('closed', function () {
  19.     mainWindow = null
  20.   })
  21. }
  22.  
  23. app.on('ready', createWindow)
  24.  
  25. // Quit when all windows are closed.
  26. app.on('window-all-closed', function () {
  27.   if (process.platform !== 'darwin') {
  28.     app.quit()
  29.   }
  30. })
  31.  
  32. app.on('activate', function () {
  33.   if (mainWindow === null) {
  34.     createWindow()
  35.   }
  36. })
  37.  
  38. // In this file you can include the rest of your app's specific main process
  39. // code. You can also put them in separate files and require them here.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement