Guest User

Untitled

a guest
Jul 19th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. const path = require('path')
  2. const { app, Tray } = require('electron')
  3.  
  4. let win
  5.  
  6. function createWindow() {
  7. appIcon = new Tray('macosx-menubar-icon.png')
  8.  
  9. appIcon.on('click', () => {
  10. console.log('click fired')
  11. })
  12.  
  13. appIcon.on('drag-end', () => {
  14. console.log('drag-end fired')
  15. })
  16. }
  17.  
  18. app.on('ready', createWindow)
  19.  
  20. app.on('window-all-closed', () => {
  21. if (process.platform !== 'darwin') {
  22. app.quit()
  23. }
  24. })
  25.  
  26. app.on('activate', () => {
  27. if (win === null) {
  28. createWindow()
  29. }
  30. })
Add Comment
Please, Sign In to add comment