Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const path = require('path')
- const { app, Tray } = require('electron')
- let win
- function createWindow() {
- appIcon = new Tray('macosx-menubar-icon.png')
- appIcon.on('click', () => {
- console.log('click fired')
- })
- appIcon.on('drag-end', () => {
- console.log('drag-end fired')
- })
- }
- app.on('ready', createWindow)
- app.on('window-all-closed', () => {
- if (process.platform !== 'darwin') {
- app.quit()
- }
- })
- app.on('activate', () => {
- if (win === null) {
- createWindow()
- }
- })
Add Comment
Please, Sign In to add comment