Struct winsafe::gui::spec::StatusBarParts
source · pub struct StatusBarParts<'a> { /* private fields */ }
Available on crate feature
gui
only.Expand description
Exposes the part methods of a StatusBar
control.
You cannot directly instantiate this object, it is created internally by the control.
Implementations§
source§impl<'a> StatusBarParts<'a>
impl<'a> StatusBarParts<'a>
sourcepub fn count(&self) -> u8
pub fn count(&self) -> u8
Retrieves the number of parts by sending an
sb::GetParts
message.
sourcepub const fn get(&self, index: u8) -> StatusBarPart<'a>
pub const fn get(&self, index: u8) -> StatusBarPart<'a>
Retrieves the part at the given zero-based position.
Note: This method is cheap – even if index
is beyond the range of
existing parts, an object will still be returned. However, operations
upon this object will produce no effect.
sourcepub fn set_texts(&self, texts: &[Option<impl AsRef<str>>])
pub fn set_texts(&self, texts: &[Option<impl AsRef<str>>])
Sets the texts of multiple parts at once.
§Panics
Panics if texts
is empty, or if the number of texts is greater than
the number of columns.
§Examples
use winsafe::{self as w, prelude::*, gui};
let my_sb: gui::StatusBar; // initialized somewhere
my_sb.parts().set_texts(&[
Some("First"),
None, // 2nd part won't have its text changed
Some("Third"),
Some("Fourth"),
]);
Auto Trait Implementations§
impl<'a> Freeze for StatusBarParts<'a>
impl<'a> !RefUnwindSafe for StatusBarParts<'a>
impl<'a> !Send for StatusBarParts<'a>
impl<'a> !Sync for StatusBarParts<'a>
impl<'a> Unpin for StatusBarParts<'a>
impl<'a> !UnwindSafe for StatusBarParts<'a>
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