pub struct StatusItem { /* private fields */ }Expand description
A live status item. Dropping it removes the item from the bus.
Implementations§
Source§impl StatusItem
impl StatusItem
Sourcepub fn new<F>(
conn: &Connection,
item: Item,
menu: Vec<MenuEntry>,
on_event: F,
) -> Result<StatusItem, Error>
pub fn new<F>( conn: &Connection, item: Item, menu: Vec<MenuEntry>, on_event: F, ) -> Result<StatusItem, Error>
Exports the item and its menu on conn and registers with the watcher if one is
running (and again whenever one starts). on_event runs on the connection’s reader
thread, so it should hand the event on rather than block.
§Errors
Returns an error when the item’s or the menu’s object path is already exported on conn,
when the item’s bus name cannot be owned, or when a call to the bus or the watcher fails.
Sourcepub fn service(&self) -> &str
pub fn service(&self) -> &str
The bus name the item registered under: its own well-known name, or the connection’s unique name inside a sandbox.
Replaces the menu and tells hosts to fetch it again.
§Errors
Returns an error when the LayoutUpdated signal cannot be sent.
Sourcepub fn set_icon(
&self,
icon_name: &str,
pixmaps: Vec<Pixmap>,
) -> Result<(), Error>
pub fn set_icon( &self, icon_name: &str, pixmaps: Vec<Pixmap>, ) -> Result<(), Error>
Replaces the icon (theme name and pixmaps).
§Errors
Returns an error when the NewIcon signal cannot be sent.