basic windows stuff(that really needs tweaking duh)
This commit is contained in:
parent
19a3d51a5c
commit
76f002dacf
33
freechat-client/main.js
Normal file
33
freechat-client/main.js
Normal file
@ -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();
|
||||||
|
}
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user