Created
April 29, 2017 16:30
-
-
Save hajipy/5f86aab7c6d525074e22d38407710665 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <reference path="typings/globals/node/index.d.ts" /> | |
import electron = require("electron"); | |
const app = electron.app; | |
const BrowserWindow = electron.BrowserWindow; | |
let window; | |
function createWindow(): void { | |
window = new BrowserWindow({width: 800, height: 600}); | |
window.loadURL("file://" + __dirname + "/index.html"); | |
window.webContents.openDevTools(); | |
window.on("closed", () => { | |
window = null; | |
}) | |
} | |
app.on("ready", createWindow); | |
app.on("window-all-closed", () => { | |
if (process.platform != 'darwin') { | |
app.quit(); | |
} | |
}); | |
app.on("activate", () => { | |
if (window == null) { | |
createWindow(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment