Struct winsafe::gui::spec::TabItems

source ·
pub struct TabItems<'a> { /* private fields */ }
Available on crate feature gui only.
Expand description

Exposes the methods of a Tab control.

You cannot directly instantiate this object, it is created internally by the control.

Implementations§

source§

impl<'a> TabItems<'a>

source

pub unsafe fn add(&self, title: &str) -> TabItem<'a>

Manually appends a new tab by sending a tcm::InsertItem message, and returns the newly added item.

§Safety

By adding a tab item manually, you are responsible for all the message handling. Prefer adding items automatically by filling the TabOpts::items member when calling the Tab::new function.

source

pub fn count(&self) -> u32

Retrieves the total number of items by sending an tcm::GetItemCount message.

source

pub unsafe fn delete_all(&self)

Deletes all items by sending a tcm::DeleteAllItems message.

§Safety

If you delete a tab automatically created, which has a container window attached to it, the rendering will be out-of-order.

source

pub const fn get(&self, index: u32) -> TabItem<'a>

Retrieves the item at the given zero-based position.

Note: This method is cheap – even if index is beyond the range of existing items, an object will still be returned. However, operations upon this object will produce no effect.

source

pub fn focused(&self) -> Option<TabItem<'a>>

Returns the focused item by sending a tcm::GetCurSel message.

source

pub fn selected(&self) -> Option<TabItem<'a>>

Returns the selected item by sending a tcm::GetCurSel message.

Auto Trait Implementations§

§

impl<'a> Freeze for TabItems<'a>

§

impl<'a> !RefUnwindSafe for TabItems<'a>

§

impl<'a> !Send for TabItems<'a>

§

impl<'a> !Sync for TabItems<'a>

§

impl<'a> Unpin for TabItems<'a>

§

impl<'a> !UnwindSafe for TabItems<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.