-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
46 lines (37 loc) · 978 Bytes
/
main.js
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
/**
* electron load js
* @authors Orz
* @date 2016-04-18 15:30:58
* @version $Id$
*/
'use strict';
global.ROOT = __dirname;
var app = require('app');
var BrowserWindow = require('browser-window');
var mainWindow = null;
const ipcMain = require('electron').ipcMain;
app.on('ready', function() {
mainWindow = new BrowserWindow({
height: 532,
width: 800,
autoHideMenuBar: true,
useContentSize: true,
frame: false,
resizable: false,
});
mainWindow.loadURL('file://' + __dirname + '/index.html');
mainWindow.center()
ipcMain.on('close-main-window', function() {
console.log('close');
app.quit();
});
ipcMain.on('minimize-main-window', function() {
console.log('mini');
mainWindow.minimize();
});
// ipcMain.on('open-develop', function() {
// console.log('develop');
// mainWindow.openDevTools();
// });
});
app.setName('FIX BOX')