Struct cursive::views::SizedView
[−]
[src]
pub struct SizedView<T: View> { pub view: T, pub size: Vec2, }
Wrapper around a view that remembers its size.
Fields
view: T
Wrapped view.
size: Vec2
Cached size from the last layout() call.
Methods
impl<T: View> SizedView<T>
[src]
fn new(view: T) -> Self
Wraps the given view.
Trait Implementations
impl<T: View> ViewWrapper for SizedView<T>
[src]
type V = T
Type that this view wraps.
fn with_view<F, R>(&self, f: F) -> Option<R> where F: FnOnce(&Self::V) -> R
Get an immutable reference to the wrapped view.
fn with_view_mut<F, R>(&mut self, f: F) -> Option<R> where F: FnOnce(&mut Self::V) -> R
Get a mutable reference to the wrapped view.
fn wrap_layout(&mut self, size: Vec2)
Wraps the layout
method.
fn wrap_draw(&self, printer: &Printer)
Wraps the draw
method.
fn wrap_required_size(&mut self, req: Vec2) -> Vec2
Wraps the required_size
method.
fn wrap_on_event(&mut self, ch: Event) -> EventResult
Wraps the on_event
method.
fn wrap_take_focus(&mut self, source: Direction) -> bool
Wraps the take_focus
method.
fn wrap_call_on_any<'a>(&mut self,
selector: &Selector,
callback: Box<FnMut(&mut Any) + 'a>)
selector: &Selector,
callback: Box<FnMut(&mut Any) + 'a>)
Wraps the find
method.
fn wrap_focus_view(&mut self, selector: &Selector) -> Result<(), ()>
Wraps the focus_view
method.
fn wrap_needs_relayout(&self) -> bool
Wraps the needs_relayout
method.