-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.js
More file actions
48 lines (38 loc) · 1.06 KB
/
main.js
File metadata and controls
48 lines (38 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
const { app, BrowserWindow, ipcMain} = require('electron')
const { exec } = require('child_process');
const apc = require('./ipc');
apc.init();
let mainWindow = null
function FormMain() {
mainWindow = new BrowserWindow({
width: 1200,
height: 900,
webPreferences: {
nodeIntegration: true,
contextIsolation: false,
webSecurity: false,
devTools: false,
// preload: path.join(__dirname, 'preload.js'),
zoomFactor: 0.68
},
autoHideMenuBar: true,
// icon: path.join(__dirname, '256x256.png'),
})
mainWindow.loadFile('app/public/index.html');
mainWindow.on('closed', function () {
mainWindow = null;
if (process.platform !== 'darwin') app.quit()
});
}
app.whenReady().then(() => {
FormMain()
app.on('activate', function () {
if (BrowserWindow.getAllWindows().length === 0) FormMain()
})
})
app.on('window-all-closed', function () {
if (process.platform !== 'darwin') app.quit()
})
app.on('before-quit', () => {
// Encerra o processo Python quando o aplicativo está prestes a ser fechado
});