-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.electron.ts
More file actions
31 lines (24 loc) · 838 Bytes
/
main.electron.ts
File metadata and controls
31 lines (24 loc) · 838 Bytes
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
import * as electron from 'electron';
// browser-window creates a native window
console.log(' Launching ');
const app = electron.app;
const browserWindow = electron.BrowserWindow;
let mainWindow;
app.on('window-all-closed', function () {
if (process.platform != 'darwin') {
app.quit();
}
});
app.on('ready', function () {
console.log(' Starting ');
// Initialize the window to our specified dimensions
mainWindow = new browserWindow({ width: 1200, height: 900 });
let indexPath: string = 'file://' + __dirname + '/index.html';
console.log(' Index path ' + indexPath);
// Tell Electron where to load the entry point from
mainWindow.loadURL(indexPath);
// Clear out the main window when the app is closed
mainWindow.on('closed', function () {
mainWindow = null;
});
});