Struct titik::TabBox [−][src]
A Tab box contains multiple box which can only be shown one at a time
ⓘ
╭──────╮──────┬──────╮ │ tab1 │ tab2 │ tab2 │ ┌──┘ └──────┴──────┴────────┐ │ │ │ │ │ │ │ │ │ │ └────────────────────────────────┘
Implementations
impl<MSG> TabBox<MSG>
[src]
pub fn new() -> Self
[src]
creates a new tab box
pub fn clear_children(&mut self)
[src]
remove all children of this flex_box
pub fn add_child_to_tab(
&mut self,
tab_index: usize,
child: Box<dyn Widget<MSG>>
) -> bool
[src]
&mut self,
tab_index: usize,
child: Box<dyn Widget<MSG>>
) -> bool
pub fn vertical(&mut self)
[src]
set to vertical column direction
pub fn horizontal(&mut self)
[src]
set to horizontal row direction
pub fn draw_labels(&self, buf: &mut Buffer, canvas: &mut Canvas)
[src]
╭──────╮──────┬──────╮ │ tab1 │ tab2 │ tab2 │ └──────┴──────┴──────┴
pub fn set_tab_labels(&mut self, labels: Vec<String>)
[src]
set the tab labels
pub fn set_active_tab(&mut self, index: usize)
[src]
set the active tab index
Trait Implementations
impl<MSG: Debug> Debug for TabBox<MSG>
[src]
impl<MSG> Widget<MSG> for TabBox<MSG> where
MSG: Debug + 'static,
[src]
MSG: Debug + 'static,
fn layout(&self) -> Option<&Layout>
[src]
fn set_layout(&mut self, layout: Layout)
[src]
fn get_offset(&self) -> (f32, f32)
[src]
the tab box has an offset of 2 from the top before drawing the child components
fn style(&self) -> Style
[src]
fn draw(&self, buf: &mut Buffer) -> Vec<Cmd>
[src]
fn add_child(&mut self, child: Box<dyn Widget<MSG>>) -> bool
[src]
add a child widget to the current active tab
fn children(&self) -> Option<&[Box<dyn Widget<MSG>>]>
[src]
fn children_mut(&mut self) -> Option<&mut [Box<dyn Widget<MSG>>]>
[src]
fn take_child(&mut self, index: usize) -> Option<Box<dyn Widget<MSG>>>
[src]
fn child_mut<'a>(
&'a mut self,
index: usize
) -> Option<&'a mut Box<dyn Widget<MSG>>>
[src]
&'a mut self,
index: usize
) -> Option<&'a mut Box<dyn Widget<MSG>>>
fn as_any(&self) -> &dyn Any
[src]
fn as_any_mut(&mut self) -> &mut dyn Any
[src]
fn set_size(&mut self, width: Option<f32>, height: Option<f32>)
[src]
fn set_id(&mut self, id: &str)
[src]
fn get_id(&self) -> &Option<String>
[src]
fn process_event(&mut self, event: Event) -> Vec<MSG>
[src]
fn style_node(&self, stretch: &mut Stretch) -> Option<Node>
[src]
fn set_focused(&mut self, _focused: bool)
[src]
fn as_mut(&mut self) -> Option<&mut Self> where
Self: Sized + 'static,
[src]
Self: Sized + 'static,
Auto Trait Implementations
impl<MSG> !RefUnwindSafe for TabBox<MSG>
impl<MSG> !Send for TabBox<MSG>
impl<MSG> !Sync for TabBox<MSG>
impl<MSG> Unpin for TabBox<MSG>
impl<MSG> !UnwindSafe for TabBox<MSG>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,