From 76f002dacfde178a688660f09e05a747a5947d3b Mon Sep 17 00:00:00 2001 From: shockrahwow Date: Tue, 26 Nov 2019 23:42:45 -0800 Subject: [PATCH] basic windows stuff(that really needs tweaking duh) --- freechat-client/main.js | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 freechat-client/main.js diff --git a/freechat-client/main.js b/freechat-client/main.js new file mode 100644 index 0000000..7405778 --- /dev/null +++ b/freechat-client/main.js @@ -0,0 +1,33 @@ +const { app, BrowserWindow } = require('electron') + +let win; + +function createWin() { + let win = new BrowserWindow({ + width: 800, + height: 600, + webPreferences: { + nodeIntegration: true + } + }) + win.loadFile('index.html'); + //win.webContents.openDevTools() + win.on('closed', () => { + win = null + }); + + +} +app.on('ready', createWin); +// on mac just because the windows are closed doesn't mean the application is too +app.on('window-all-closed', () => { + if(process.platform !== 'darwin') { + app.quit() + } +}); + +app.on('activate', () => { + if(win === null) { + createWin(); + } +});