Struct cursive::views::Canvas [] [src]

pub struct Canvas<T> { /* fields omitted */ }

A blank view that forwards calls to closures.

You can use this view to easily draw your own interface.

Methods

impl<T> Canvas<T>
[src]

Creates a new, empty Canvas.

Examples

let canvas = Canvas::new(())
                    .with_draw(|printer, _| {
                        // Print the view
                    });

Gets a mutable reference to the inner state.

Sets the closure for draw(&Printer).

Sets the closure for draw(&Printer).

Chainable variant.

Sets the closure for on_event(Event).

Sets the closure for on_event(Event).

Chainable variant.

Sets the closure for required_size(Vec2).

Sets the closure for required_size(Vec2).

Chainable variant.

Sets the closure for layout(Vec2).

Sets the closure for layout(Vec2).

Chainable variant.

Sets the closure for take_focus(Direction).

Sets the closure for take_focus(Direction).

Chainable variant.

Sets the closure for needs_relayout().

Sets the closure for needs_relayout().

Chainable variant.

Trait Implementations

impl<T> View for Canvas<T>
[src]

Draws the view with the given printer (includes bounds) and focus.

Called when a key was pressed. Read more

Returns the minimum size the view requires with the given restrictions. Read more

Called once the size for this view has been decided, Read more

This view is offered focus. Will it take it? Read more

Returns true if the view content changed since last layout phase. Read more

Runs a closure on the view identified by the given selector. Read more

Moves the focus to the view identified by the given selector. Read more