[][src]Struct kas::widget::Splitter

pub struct Splitter<D: Directional, W: Widget> { /* fields omitted */ }

A resizable row/column widget

Similar to kas::widget::List but with draggable handles between items.

Methods

impl<D: Directional + Default, W: Widget> Splitter<D, W>[src]

pub fn new(widgets: Vec<W>) -> Self[src]

Construct a new instance

This constructor is available where the direction is determined by the type: for D: Directional + Default. In other cases, use Splitter::new_with_direction.

impl<D: Directional, W: Widget> Splitter<D, W>[src]

pub fn new_with_direction(direction: D, widgets: Vec<W>) -> Self[src]

Construct a new instance with explicit direction

pub fn is_empty(&self) -> bool[src]

True if there are no child widgets

pub fn len(&self) -> usize[src]

Returns the number of child widgets (excluding handles)

pub fn capacity(&self) -> usize[src]

Returns the number of elements the vector can hold without reallocating.

pub fn reserve(&mut self, additional: usize)[src]

Reserves capacity for at least additional more elements to be inserted into the list. See documentation of Vec::reserve.

pub fn clear(&mut self) -> TkAction[src]

Remove all child widgets

Triggers a reconfigure action if any widget is removed.

pub fn push(&mut self, widget: W) -> TkAction[src]

Append a child widget

Triggers a reconfigure action.

pub fn pop(&mut self) -> (Option<W>, TkAction)[src]

Remove the last child widget

Returns None if there are no children. Otherwise, this triggers a reconfigure before the next draw operation.

Triggers a reconfigure action if any widget is removed.

pub fn insert(&mut self, index: usize, widget: W) -> TkAction[src]

Inserts a child widget position index

Panics if index > len.

Triggers a reconfigure action.

pub fn remove(&mut self, index: usize) -> (W, TkAction)[src]

Removes the child widget at position index

Panics if index is out of bounds.

Triggers a reconfigure action.

pub fn replace(&mut self, index: usize, widget: W) -> (W, TkAction)[src]

Replace the child at index

Panics if index is out of bounds.

Triggers a reconfigure action.

pub fn extend<T: IntoIterator<Item = W>>(&mut self, iter: T) -> TkAction[src]

Append child widgets from an iterator

Triggers a reconfigure action if any widgets are added.

pub fn resize_with<F: Fn(usize) -> W>(&mut self, len: usize, f: F) -> TkAction[src]

Resize, using the given closure to construct new widgets

Triggers a reconfigure action.

pub fn retain<F: FnMut(&W) -> bool>(&mut self, f: F) -> TkAction[src]

Retain only widgets satisfying predicate f

See documentation of Vec::retain.

Triggers a reconfigure action if any widgets are removed.

Trait Implementations

impl<D: Clone + Directional, W: Clone + Widget> Clone for Splitter<D, W>[src]

impl<D: Debug + Directional, W: Debug + Widget> Debug for Splitter<D, W>[src]

impl<D: Default + Directional, W: Default + Widget> Default for Splitter<D, W>[src]

impl<D: Directional, W: Widget> Handler for Splitter<D, W>[src]

type Msg = <W as Handler>::Msg

Type of message returned by this widget Read more

impl<D: Directional, W: Widget> Index<usize> for Splitter<D, W>[src]

type Output = W

The returned type after indexing.

impl<D: Directional, W: Widget> IndexMut<usize> for Splitter<D, W>[src]

impl<D: Directional, W: Widget> Layout for Splitter<D, W>[src]

impl<D: Directional, W: Widget> SendEvent for Splitter<D, W>[src]

impl<D: Directional, W: Widget> Widget for Splitter<D, W>[src]

impl<D: Directional, W: Widget> WidgetChildren for Splitter<D, W>[src]

impl<D: Directional, W: Widget> WidgetConfig for Splitter<D, W>[src]

impl<D: Directional, W: Widget> WidgetCore for Splitter<D, W>[src]

Auto Trait Implementations

impl<D, W> RefUnwindSafe for Splitter<D, W> where
    D: RefUnwindSafe,
    W: RefUnwindSafe

impl<D, W> Send for Splitter<D, W> where
    D: Send,
    W: Send

impl<D, W> Sync for Splitter<D, W> where
    D: Sync,
    W: Sync

impl<D, W> Unpin for Splitter<D, W> where
    D: Unpin,
    W: Unpin

impl<D, W> UnwindSafe for Splitter<D, W> where
    D: UnwindSafe,
    W: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<Src, Scheme> ApproxFrom<Src, Scheme> for Src where
    Scheme: ApproxScheme
[src]

type Err = NoError

The error type produced by a failed conversion.

impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Src where
    Dst: ApproxFrom<Src, Scheme>,
    Scheme: ApproxScheme
[src]

type Err = <Dst as ApproxFrom<Src, Scheme>>::Err

The error type produced by a failed conversion.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, Dst> ConvAsUtil<Dst> for T[src]

impl<T> ConvUtil for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<Src> TryFrom<Src> for Src[src]

type Err = NoError

The error type produced by a failed conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<Src, Dst> TryInto<Dst> for Src where
    Dst: TryFrom<Src>, 
[src]

type Err = <Dst as TryFrom<Src>>::Err

The error type produced by a failed conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<Src> ValueFrom<Src> for Src[src]

type Err = NoError

The error type produced by a failed conversion.

impl<Src, Dst> ValueInto<Dst> for Src where
    Dst: ValueFrom<Src>, 
[src]

type Err = <Dst as ValueFrom<Src>>::Err

The error type produced by a failed conversion.