-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMainElectron.hx
43 lines (40 loc) · 990 Bytes
/
MainElectron.hx
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
// main electron entry-point
import js.Node;
import js.Node.__dirname;
import electron.main.App;
import electron.main.BrowserWindow;
class MainElectron
{
static function main()
{
App.on(ready, function(e)
{
var isClassic = App.commandLine.hasSwitch('classic');
var win = new BrowserWindow({
icon: __dirname + '/' +
(isClassic ? 'favicon-classic.png' : 'favicon.png'),
width: 1056,
height: 685,
webPreferences: {
nodeIntegration: true
}
});
#if !mydebug
win.setMenu(null);
#end
win.on( closed, function() {
win = null;
});
win.loadFile(isClassic ? 'app-classic.html' : 'app.html');
/*
#if mydebug
win.webContents.openDevTools();
#end
*/
});
App.on(window_all_closed, function(e) {
if (Node.process.platform != 'darwin')
App.quit();
});
}
}