Struct cursive::views::Dialog [] [src]

pub struct Dialog {
    // some fields omitted
}

Popup-like view with a main content, and optional buttons under it.

Examples

let dialog = Dialog::new(TextView::new("Hello!"))
                    .button("Ok", |s| s.quit());

Methods

impl Dialog
[src]

Creates a new Dialog with empty content.

You should probably call content() next.

Creates a new Dialog with the given content.

Sets the content for this dialog.

Chainable variant.

Sets the content for this dialog.

Previous content will be dropped.

Convenient method to create a dialog with a simple text content.

Convenient method to create an infobox.

It will contain the given text and a Ok dismiss button.

Adds a button to the dialog with the given label and callback.

Consumes and returns self for easy chaining.

Sets the horizontal alignment for the buttons, if any.

Only works if the buttons are as a row at the bottom of the dialog.

Sets the vertical alignment for the buttons, if any.

Only works if the buttons are as a column to the right of the dialog.

Shortcut method to add a button that will dismiss the dialog.

Sets the title of the dialog.

If not empty, it will be visible at the top.

Sets the title of the dialog.

Sets the padding in the dialog (around content and buttons).

Sets the top padding in the dialog (under the title).

Sets the bottom padding in the dialog (under buttons).

Sets the left padding in the dialog.

Sets the right padding in the dialog.

Trait Implementations

impl View for Dialog
[src]

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

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

Called when a key was pressed. Default implementation just ignores it.

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

Finds the view pointed to by the given path. Read more

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