Trait cursive::view::ViewWrapper [] [src]

pub trait ViewWrapper {
    type V: View;
    fn with_view<F, R>(&self, f: F) -> Option<R>
    where
        F: FnOnce(&Self::V) -> R
;
fn with_view_mut<F, R>(&mut self, f: F) -> Option<R>
    where
        F: FnOnce(&mut Self::V) -> R
; fn wrap_draw(&self, printer: &Printer) { ... }
fn wrap_required_size(&mut self, req: Vec2) -> Vec2 { ... }
fn wrap_on_event(&mut self, ch: Event) -> EventResult { ... }
fn wrap_layout(&mut self, size: Vec2) { ... }
fn wrap_take_focus(&mut self, source: Direction) -> bool { ... }
fn wrap_call_on_any<'a>(
        &mut self,
        selector: &Selector,
        callback: Box<FnMut(&mut Any) + 'a>
    ) { ... }
fn wrap_focus_view(&mut self, selector: &Selector) -> Result<(), ()> { ... }
fn wrap_needs_relayout(&self) -> bool { ... } }

Generic wrapper around a view.

Default implementation forwards all calls to the child view. Overrides some methods as desired.

You can use the wrap_impl! macro to define with_view and with_view_mut for you.

Associated Types

Type that this view wraps.

Required Methods

Get an immutable reference to the wrapped view.

Get a mutable reference to the wrapped view.

Provided Methods

Wraps the draw method.

Wraps the required_size method.

Wraps the on_event method.

Wraps the layout method.

Wraps the take_focus method.

Wraps the find method.

Wraps the focus_view method.

Wraps the needs_relayout method.

Implementors