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: 'static + View> Canvas<T>
[src]

Creates a new Canvas around the given view.

By default, forwards all calls to the inner view.

impl<T> Canvas<T>
[src]

Creates a new, empty Canvas.

Examples

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

Important traits for &'a mut R

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.

Sets the closure for call_on_any().

Sets the closure for call_on_any().

Chainable variant.

Sets the closure for important_area().

Sets the closure for important_area().

Chainable variant.

Sets the closure for focus_view().

Sets the closure for focus_view().

Chainable variant.

Trait Implementations

impl<T: 'static> View for Canvas<T>
[src]

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

Called when an event is received (key press, mouse event, ...). 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

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

What part of the view is important and should be visible? Read more

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

Auto Trait Implementations

impl<T> !Send for Canvas<T>

impl<T> !Sync for Canvas<T>