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:
i've not been successful updating items themselves, i've tried code below remove/replace menu, appears 'flash' every time (see animaged gif)
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
Post a Comment