26 lines
469 B
JavaScript
26 lines
469 B
JavaScript
const { app, BrowserWindow } = require('electron/main')
|
|
|
|
const createWindow = () => {
|
|
const win = new BrowserWindow({
|
|
width: 1200,
|
|
height: 800
|
|
})
|
|
win.loadFile('index.html');
|
|
win.center();
|
|
}
|
|
|
|
app.whenReady().then(() => {
|
|
createWindow()
|
|
|
|
app.on('activate', () => {
|
|
if (BrowserWindow.getAllWindows().length === 0) {
|
|
createWindow()
|
|
}
|
|
})
|
|
})
|
|
|
|
app.on('window-all-closed', () => {
|
|
if (process.platform !== 'darwin') {
|
|
app.quit()
|
|
}
|
|
}) |