pub struct TrayIcon { /* private fields */ }Expand description
Notification area icon with RAII lifecycle management.
Implementations§
Source§impl TrayIcon
impl TrayIcon
Sourcepub fn new(id: TrayIconId, tooltip: &str) -> Result<Self>
pub fn new(id: TrayIconId, tooltip: &str) -> Result<Self>
Create a tray icon with an internally managed hidden message window.
This is a convenience wrapper around TrayIconBuilder, using
default internal class and window names.
Sourcepub fn builder(id: TrayIconId, tooltip: impl Into<String>) -> TrayIconBuilder
pub fn builder(id: TrayIconId, tooltip: impl Into<String>) -> TrayIconBuilder
Create a tray icon builder.
Use this when you need to customize the internal message window class name and/or window name used for tray icon ownership.
§Example
use windows_erg::desktop::{TrayIcon, TrayIconId};
let _tray = TrayIcon::builder(TrayIconId::new(1), "demo")
.window_class_name("my_app_tray_window_class")
.window_name("my_app_tray_window")
.create()?;Sourcepub fn from_window(
owner: WindowHandle,
id: TrayIconId,
tooltip: &str,
) -> Result<Self>
pub fn from_window( owner: WindowHandle, id: TrayIconId, tooltip: &str, ) -> Result<Self>
Create a tray icon bound to an existing window handle.
Sourcepub fn show_notification(&self, notification: &TrayNotification) -> Result<()>
pub fn show_notification(&self, notification: &TrayNotification) -> Result<()>
Show a tray balloon notification.
Sourcepub fn update_tooltip(&self, tooltip: &str) -> Result<()>
pub fn update_tooltip(&self, tooltip: &str) -> Result<()>
Update tray icon tooltip text.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TrayIcon
impl RefUnwindSafe for TrayIcon
impl !Send for TrayIcon
impl !Sync for TrayIcon
impl Unpin for TrayIcon
impl UnsafeUnpin for TrayIcon
impl UnwindSafe for TrayIcon
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more