[][src]Struct native_windows_gui::FlexboxLayout

pub struct FlexboxLayout { /* fields omitted */ }

A flexbox layout that organizes the children control in a parent control. Flexbox uses the stretch library internally ( https://github.com/vislyhq/stretch ).

FlexboxLayout requires the flexbox feature.

Implementations

impl FlexboxLayout[src]

pub fn builder() -> FlexboxLayoutBuilder[src]

pub fn style(&self) -> Style[src]

Returns the style of the parent control

Panic:

  • The layout must have been successfully built otherwise this function will panic.

pub fn set_style(&self, style: Style)[src]

Sets the style of the layout parent control

Panic:

  • The layout must have been successfully built otherwise this function will panic.

pub fn add_child<W: Into<ControlHandle>>(
    &self,
    c: W,
    style: Style
) -> Result<(), Error>
[src]

Add a new children in the layout with the stretch style.

Panic:

  • If the control is not a window-like control
  • If the layout was not initialized

pub fn remove_child<W: Into<ControlHandle>>(&self, c: W)[src]

Remove a children from the layout

Panic:

  • If the control is not a window-like control
  • If the control is not in the layout (see has_child)
  • If the layout was not initialized

pub fn has_child<W: Into<ControlHandle>>(&self, c: W) -> bool[src]

Check if the selected control is a children in the layout. Does not check in the sublayouts

Panic:

  • If the control is not a window-like control.
  • If the layout was not initialized

pub fn children(&self) -> FlexboxLayoutChildren<'_>[src]

Borrow the inner value of the flexbox layout. While the returned value lives, calling other method of the the flexbox layout that modify the inner state will cause a panic. Simple looktup (ex: has_child) will still work.

Panic:

  • The layout must have been successfully built otherwise this function will panic.

pub fn children_mut(&self) -> FlexboxLayoutChildrenMut<'_>[src]

Borrow the inner value of the flexbox layout as mutable. While the returned value lives, calling other method of the the flexbox layout will cause a panic.

If the children of the layout were modified, call fit to update the layout after FlexboxLayoutChildrenMut is dropped.

Panic:

  • The layout must have been successfully built otherwise this function will panic.

pub fn fit(&self) -> Result<(), Error>[src]

Resize the layout to fit the parent window size

Panic:

  • The layout must have been successfully built otherwise this function will panic.

Trait Implementations

impl Clone for FlexboxLayout[src]

impl Default for FlexboxLayout[src]

Auto Trait Implementations

Blanket Implementations

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

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

impl<T> BorrowMut<T> for T where
    T: ?Sized
[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<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<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.