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

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -