Added IPC Handlers
This commit is contained in:
parent
58b50a09e7
commit
693d383a69
1 changed files with 9 additions and 1 deletions
10
src/main.js
10
src/main.js
|
@ -4,6 +4,7 @@ var Menu = require('menu');
|
|||
var globalShortcut = require('global-shortcut')
|
||||
var fs = require('fs');
|
||||
var Tray = require('tray');
|
||||
var ipc = require('ipc');
|
||||
|
||||
require('crash-reporter').start(); // Start crash reporter
|
||||
|
||||
|
@ -12,7 +13,6 @@ var menu = new Menu();
|
|||
Menu.setApplicationMenu(menu);
|
||||
var mainWindow = null;
|
||||
|
||||
|
||||
// Make sure the application closes
|
||||
app.on('window-all-closed', function () {
|
||||
app.quit();
|
||||
|
@ -33,3 +33,11 @@ app.on('ready', function () {
|
|||
mainWindow = undefined;
|
||||
});
|
||||
});
|
||||
|
||||
ipc.on('hide', function () {
|
||||
mainWindow.hide();
|
||||
});
|
||||
|
||||
ipc.on('show', function () {
|
||||
mainWindow.show();
|
||||
});
|
Reference in a new issue