// In main process.varapp=require('app');// Module to control application life.varBrowserWindow=require('browser-window');// Module to create native browser window.varToaster=require('electron-toaster');vartoaster=newToaster();// Keep a global reference of the window object, if you don't, the window will// be closed automatically when the javascript object is GCed.varmainWindow=null;app.on('window-all-closed',function(){if(process.platform!=='darwin'){app.quit();}});app.on('ready',function(){mainWindow=newBrowserWindow({});toaster.init(mainWindow);mainWindow.on('devtools-opened',function(){mainWindow.loadUrl('file://'+__dirname+'/index.html');});mainWindow.on('closed',function(){mainWindow=null;});});
// In renderer process (web page).varipc=require('ipc');varmsg={title : "Awesome!",message : "Check this out!<br>Check this out!<br>Check this out!<br>Check this out!<br>Check this out!<br>Check this out!<br>",detail : "PI is equal to 3! - 0.0<br>PI is equal to 3! - 0.0<br>PI is equal to 3! - 0.0<br>PI is equal to 3! - 0.0<br>",width : 440,// height : 160, window will be autosizedtimeout : 6000,focus: true// set focus back to main window};ipc.send('electron-toaster-message',msg);