31 lines
611 B
JavaScript
31 lines
611 B
JavaScript
console.log('Hello world')
|
|
|
|
const { app, BrowserWindow } = require('electron')
|
|
|
|
const createWindow = () => {
|
|
const win = new BrowserWindow({
|
|
width: 800,
|
|
height: 600
|
|
})
|
|
|
|
win.loadFile('index.html')
|
|
}
|
|
|
|
app.whenReady().then(() => {
|
|
createWindow()
|
|
|
|
// MacOS window activation stuffs (??) (idk I don't use Apple products)
|
|
app.on('activate', () => {
|
|
if (BrowserWindow.getAllWindows().length === 0) {
|
|
createWindow()
|
|
}
|
|
})
|
|
})
|
|
|
|
app.on('window-all-closed', () => {
|
|
// Windows and Linux need to call app.quit manually
|
|
// otherwise process will not exit
|
|
if (process.platform !== 'darwin') app.quit()
|
|
})
|
|
|