javascript - Electron MacOS menubar icon - how to update without flashing -


i'm trying update menu items appear when using 'tray' menu in electron.

ideally want temperatures in menu update time time:

enter image description here

i've not been successful updating items themselves, i've tried code below remove/replace menu, appears 'flash' every time (see animaged gif)

enter image description here

how can either:

a) replace menu without flashing.

or

b) replace menuitem label existing menu item. (ie update temperature)

ipc.on('main_add2ndmenu', function(event) {    appicon.destroy()       contextmenu = makemenu()    appicon = new tray(iconpath)    appicon.settooltip('electron demo in tray.')    basementtemp.label = math.floor(math.random() * 10)+65  + "°f"      contextmenu.append(basementtemp)    appicon.setcontextmenu(contextmenu)  })


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -