tray.js 770 B

1234567891011121314151617181920212223242526272829
  1. /**
  2. * @author oldj
  3. * @blog http://oldj.net
  4. */
  5. "use strict";
  6. //const Tray = require('tray');
  7. let appIcon = null;
  8. function makeTray(app) {
  9. /*
  10. //console.log('file://' + __dirname + '/images/t.png');
  11. // @see https://github.com/atom/electron/blob/master/docs/api/tray.md
  12. appIcon = new Tray(__dirname + '/images/t.png');
  13. //appIcon = new Tray('/Users/wu/studio/owl/sh3/app/images/t.png');
  14. let contextMenu = Menu.buildFromTemplate([
  15. {label: 'Item1', type: 'radio'},
  16. {label: 'Item2', type: 'radio'},
  17. {label: 'Item3', type: 'radio', checked: true},
  18. {label: 'Item4', type: 'radio'}
  19. ]);
  20. appIcon.setToolTip('This is my application.');
  21. appIcon.setContextMenu(contextMenu);
  22. */
  23. }
  24. exports.makeTray = makeTray;