Created
January 30, 2019 18:12
-
-
Save YannMjl/6d1388a74637fcacaa5810a9ce099d89 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { app, BrowserWindow } = require('electron') | |
| let win; | |
| function createWindow () { | |
| // Create the browser window. | |
| win = new BrowserWindow({ | |
| width: 600, | |
| height: 670, | |
| icon: `file://${__dirname}/dist/assets/logo.png` | |
| }) | |
| win.loadURL(`file://${__dirname}/dist/index.html`) | |
| // uncomment below to open the DevTools. | |
| // win.webContents.openDevTools() | |
| // Event when the window is closed. | |
| win.on('closed', function () { | |
| win = null | |
| }) | |
| } | |
| // Create window on electron intialization | |
| app.on('ready', createWindow) | |
| // Quit when all windows are closed. | |
| app.on('window-all-closed', function () { | |
| // On macOS specific close process | |
| if (process.platform !== 'darwin') { | |
| app.quit() | |
| } | |
| }) | |
| app.on('activate', function () { | |
| // macOS specific close process | |
| if (win === null) { | |
| createWindow() | |
| } | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment