energy_system_modelling_wor.../main.js

34 lines
771 B
JavaScript
Raw Normal View History

2022-03-24 09:22:39 -04:00
const { app, BrowserWindow, dialog, ipcMain } = require('electron')
require('@electron/remote/main').initialize()
const path = require('path')
function createWindow () {
const win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true,
enableRemoteModule: true,
contextIsolation: false,
2022-03-26 12:39:40 -04:00
devTools: false,
2022-03-24 09:22:39 -04:00
preload: path.join(__dirname, 'init.js')
}
})
win.webContents.openDevTools()
win.maximize();
win.loadFile('main.html')
}
app.on('window-all-closed', function () {
if (process.platform !== 'darwin') app.quit()
})
app.whenReady().then(() => {
createWindow()
app.on('activate', function () {
if (BrowserWindow.getAllWindows().length === 0) createWindow()
})
})