docs: Add click handler to tray window example

This commit is contained in:
DaveJ 2016-07-27 23:56:00 +01:00
parent 322fe36dea
commit 42640b6170

View file

@ -202,6 +202,10 @@ const {BrowserWindow, Tray} = require('electron')
const win = new BrowserWindow({width: 800, height: 600})
const tray = new Tray('/path/to/my/icon')
tray.on('click', () => {
win.isVisible() ? win.hide() : win.show()
})
win.on('show', () => {
tray.setHighlightMode('always')
})