-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.js
More file actions
53 lines (42 loc) · 1.16 KB
/
Copy pathmain.js
File metadata and controls
53 lines (42 loc) · 1.16 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
48
49
50
process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = true;
const {app, BrowserWindow} = require('electron')
let mainWindow, openwindow;
function createWindow() {
mainWindow = new BrowserWindow({
frame: false,
width: 1120,
height: 700,
webPreferences: {
nodeIntegration: true,
},
show: false,
});
mainWindow.loadFile('index.html');
mainWindow.once('ready-to-show', () => {
mainWindow.show()
})
// mainWindow.webContents.openDevTools()
mainWindow.on('closed', function () {
});
mainWindow.on('active', function () {
if (mainWindow == null) {
createWindow();
}
});
}
app.on('ready', createWindow);
app.on('window-all-closed', function () {
if (process.platform != 'darwin') {
app.quit();
}
});
app.on('active', function () {
if (mainWindow == null) {
createWindow();
}
});
/* ipcMain.on('open-window', function(event, x, y) {
mainWindow.setSize(x, y)
openwindow = new BrowserWindow({modal: true, parent: mainWindow, width: 400, height: 400, backgroundColor: '#431233'});
openwindow.show()
}) */