Created
February 8, 2016 17:49
-
-
Save zoobab/913b6cf886024b18cafd 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
'use strict'; | |
const electron = require ('electron'); | |
const app = electron.app; | |
const BrowserWindow = electron.BrowserWindow; | |
var mainWindow = null; | |
var zyre = null; | |
var ipcMain = require('electron').ipcMain; | |
global.sharedObj = {prop1: "hello3"}; | |
ipcMain.on('show-prop1', function(event) { | |
console.log(global.sharedObj.prop1); | |
}); | |
app.on ('window-all-closed', function () { | |
if (process.platform != 'darwin') { | |
app.quit (); | |
} | |
}); | |
app.on ('ready', function () { | |
var ZyreBinding = require ('bindings')('zyre'); | |
var zyre = new ZyreBinding.Zyre (); | |
var zyrename = zyre.name (); | |
console.log ('Node name is: ' + zyrename + ' EOL'); | |
global.sharedObj = {prop1: zyrename}; | |
mainWindow = new BrowserWindow ({ width:800, height:600 }); | |
mainWindow.loadURL ('file://' + __dirname + '/index.html'); | |
mainWindow.webContents.openDevTools (); | |
mainWindow.on ('closed', function () { | |
zyre.destroy (); | |
mainWindow = null; | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment