Struct tauri::SystemTrayHandle
source · Available on crate feature
system-tray
only.Expand description
A handle to a system tray. Allows updating the context menu items.
Implementations§
source§impl<R: Runtime> SystemTrayHandle<R>
impl<R: Runtime> SystemTrayHandle<R>
sourcepub fn get_item(&self, id: MenuIdRef<'_>) -> SystemTrayMenuItemHandle<R>
pub fn get_item(&self, id: MenuIdRef<'_>) -> SystemTrayMenuItemHandle<R>
Gets a handle to the menu item that has the specified id
.
Updates the tray menu.
sourcepub fn destroy(&self) -> Result<()>
pub fn destroy(&self) -> Result<()>
Destroys this system tray.
Examples found in repository?
src/app.rs (line 551)
543 544 545 546 547 548 549 550 551 552 553 554
fn cleanup_before_exit(&self) {
#[cfg(any(shell_execute, shell_sidecar))]
{
crate::api::process::kill_children();
}
#[cfg(all(windows, feature = "system-tray"))]
{
for tray in self.manager().trays().values() {
let _ = tray.destroy();
}
}
}