Struct cursive::views::KeyEventView [] [src]

pub struct KeyEventView<T: View> { /* fields omitted */ }

A simple wrapper view that catches some ignored event from its child.

If the event doesn't have a corresponding callback, it will stay ignored.

Examples

let view = KeyEventView::new(TextView::new("This view has an event!"))
                        .register('q', |s| s.quit())
                        .register(event::Key::Esc, |s| s.quit());

Methods

impl<T: View> KeyEventView<T>
[src]

Wraps the given view in a new KeyEventView.

Registers a callback when the given key is ignored by the child.

Trait Implementations

impl<T: View> ViewWrapper for KeyEventView<T>
[src]

Type that this view wraps.

Get an immutable reference to the wrapped view.

Get a mutable reference to the wrapped view.

Wraps the on_event method.

Wraps the draw method.

Wraps the required_size method.

Wraps the layout method.

Wraps the take_focus method.

Wraps the find method.

Wraps the focus_view method.

Wraps the needs_relayout method.