Replies: 1 comment
|
Yeah, this is a common Windows quirk. On macOS, replacing the tray menu with What usually works better in Tauri v2:
// when building the menu once
let clock = MenuItem::with_id(app, "clock", "12:00:00", false, None::<&str>)?;
app.manage(ClockItem(clock.clone()));
// later, on a timer
if let Some(state) = app.try_state::<ClockItem>() {
let _ = state.0.set_text(now_string);
}
In HalalDL I only refresh the tray menu on real state changes (active downloads, pause, updates, etc.), not on a 1 Hz timer — that pattern has been much happier on Windows. Hope that helps! |
Uh oh!
There was an error while loading. Please reload this page.
I am trying to display a timer in my tray menu, so it shows the current time.
I thought I just have to replace the whole menu with
tray.set_menu. This works fine under MacOS, but not under Windows. Under windows the menu only get updated every once in a while and is not consistent.Is there maybe a different way?
Maybe someone has an idea.
All reactions