Struct rat_widget::layout::LayoutEdit
source · pub struct LayoutEdit { /* private fields */ }Expand description
Layout generated by layout_edit
Implementations§
source§impl LayoutEdit
impl LayoutEdit
sourcepub fn label(&self, n: usize) -> Rect
pub fn label(&self, n: usize) -> Rect
Returns label number n. Panics if out of bounds or if there is no label at this position.
sourcepub fn widget(&self, n: usize) -> Rect
pub fn widget(&self, n: usize) -> Rect
Returns widget number n. Panics if out of bounds or if there is no widget at this position.
sourcepub fn label_at(&self, pos: (u16, u16)) -> Option<usize>
pub fn label_at(&self, pos: (u16, u16)) -> Option<usize>
Returns the label nr at the given position.
sourcepub fn widget_at(&self, pos: (u16, u16)) -> Option<usize>
pub fn widget_at(&self, pos: (u16, u16)) -> Option<usize>
Returns the widget nr at the given position.
sourcepub fn iter(&self) -> LayoutEditIterator<'_>
pub fn iter(&self) -> LayoutEditIterator<'_>
Create an iterator look-alike that gives access to both label and widget areas.
If you render your widgets in the order of the layout, you don’t need widget indexes any longer.
Trait Implementations§
source§impl Debug for LayoutEdit
impl Debug for LayoutEdit
source§impl Default for LayoutEdit
impl Default for LayoutEdit
source§fn default() -> LayoutEdit
fn default() -> LayoutEdit
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for LayoutEdit
impl RefUnwindSafe for LayoutEdit
impl Send for LayoutEdit
impl Sync for LayoutEdit
impl Unpin for LayoutEdit
impl UnwindSafe for LayoutEdit
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more