12345678910111213141516171819202122232425262728293031323334353637383940 |
- const { app, BrowserWindow } = require('electron')
- //const { spawn } = require("child_process");
-
- function createWindow() {
- // Crea la ventana del navegador.
- let win = new BrowserWindow({
- minHeight: 768,
- minWidth: 1366,
- width: 1366,
- height: 768,
- webPreferences: {
- nodeIntegration: true
- },
- autoHideMenuBar: true
- })
- // y carga el index.html de la aplicación.
- win.loadFile('build/index.html')
- }
-
-
- app.whenReady().then(() => {
- createWindow()
- })
-
- // Finaliza cuando todas las ventanas estén cerradas.
- app.on('window-all-closed', () => {
- // En macOS es común para las aplicaciones y sus barras de menú
- // que estén activas hasta que el usuario salga explicitamente con Cmd + Q
- if (process.platform !== 'darwin') {
- app.quit()
- }
- })
-
- app.on('activate', () => {
- // En macOS es común volver a crear una ventana en la aplicación cuando el
- // icono del dock es clicado y no hay otras ventanas abiertas.
- if (BrowserWindow.getAllWindows().length === 0) {
- createWindow()
- }
- })
|