Files
cameradar/gui/electron_app/index.js
T
Gael du Plessix 71046216ce Add GUI dev environment (#114)
Setup dev tools to build GUI using ReasonML + Electron

Use react-scripts instead of custom build config

Add electron command

Rename command
2018-03-12 15:04:05 +01:00

35 lines
901 B
JavaScript

// This is the entry point of the electron app
// It manages the overall state of the native app (menus, windows, ...)
// TODO: launch cameradar process
const { app, BrowserWindow } = require('electron');
const path = require('path');
const url = require('url');
let mainWindow;
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.on('ready', () => {
// create the browser window.
mainWindow = new BrowserWindow({ width: 800, height: 600 });
// and load the index.html of the app.
mainWindow.loadURL(
url.format({
pathname: `${__dirname}/../build/index.html`,
protocol: 'file:',
}),
);
// Open the DevTools.
mainWindow.webContents.openDevTools({
mode: 'bottom',
});
mainWindow.on('closed', () => {
mainWindow = null;
});
});