Struct cursive::views::Button [] [src]

pub struct Button { /* fields omitted */ }

Simple text label with a callback when is pressed.

A button shows its content in a single line and has a fixed size.

Examples

let quit_button = Button::new("Quit", |s| s.quit());

Methods

impl Button
[src]

[src]

Creates a new button with the given content and callback.

[src]

Sets the function to be called when the button is pressed.

Replaces the previous callback.

[src]

Disables this view.

A disabled view cannot be selected.

[src]

Disables this view.

Chainable variant.

[src]

Re-enables this view.

[src]

Enable or disable this view.

[src]

Returns true if this view is enabled.

Trait Implementations

impl View for Button
[src]

[src]

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

[src]

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

[src]

Called when a key was pressed. Read more

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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