[−][src]Struct native_windows_gui::FlexboxLayout
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]
&self,
c: W,
style: Style
) -> Result<(), Error>
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]
fn clone(&self) -> FlexboxLayout
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Default for FlexboxLayout
[src]
fn default() -> FlexboxLayout
[src]
Auto Trait Implementations
impl !RefUnwindSafe for FlexboxLayout
impl !Send for FlexboxLayout
impl !Sync for FlexboxLayout
impl Unpin for FlexboxLayout
impl !UnwindSafe for FlexboxLayout
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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>,