Trying to find out how to reference my Tray object. It has been created, but for some reason, I cannot seem to find out how to call it for reference. Trying via dev console...
require('electron').remote.Tray
This seems to get the native function for Tray... I have tried remote.getTray()
and a few others.. I am using electron-vue. Here is my electron.js
setup.
'use strict'
const electron = require('electron')
const path = require('path')
const app = electron.app
const BrowserWindow = electron.BrowserWindow
var {Menu, Tray} = require('electron')
let tray = null
app.on('ready', () => {
tray = new Tray(__dirname + '\\icons\\twitch.ico')
const contextMenu = Menu.buildFromTemplate([
{label: 'Item1', type: 'radio'},
{label: 'Item2', type: 'radio'},
{label: 'Item3', type: 'radio', checked: true},
{label: 'Item4', type: 'radio'}
]);
tray.setToolTip('Welcome')
tray.setContextMenu(contextMenu)
})
...
I do not know how to reference it correctly. Here is the Tray Documentation
My ultimate goal is to use some of the Instance Methods (located in the Tray Documentation)
Thanks!