Struct cursive::views::StackView[][src]

pub struct StackView { /* fields omitted */ }

Simple stack of views. Only the top-most view is active and can receive input.

Methods

impl StackView
[src]

Creates a new empty StackView

Adds a new full-screen layer on top of the stack.

Fullscreen layers have no shadow.

Adds new view on top of the stack in the center of the screen.

Adds new view on top of the stack in the center of the screen.

Chainable variant.

Returns a reference to the layer at the given position.

Returns a mutable reference to the layer at the given position.

Looks for the layer containing a view with the given ID.

Returns Some(pos) if self.get(pos) has the given ID, or is a parent of a view with this ID.

Returns None if the given ID is not found.

Examples

let mut stack = StackView::new();
stack.add_layer(TextView::new("Back"));
stack.add_layer(Dialog::around(TextView::new("Middle").with_id("text")));
stack.add_layer(TextView::new("Front"));

assert_eq!(stack.find_layer_from_id("text"), Some(LayerPosition::FromBack(1)));

Adds a new full-screen layer on top of the stack.

Chainable variant.

Adds a new transparent layer on top of the stack.

Chainable variant.

Adds a view on top of the stack.

Adds a transparent view on top of the stack in the center of the screen.

Adds a transparent view on top of the stack.

Adds a view on top of the stack.

Chainable variant.

Remove the top-most layer.

Computes the offset of the current top view.

Important traits for Vec<u8>

Returns the size for each layer in this view.

Moves a layer to a new position in the stack.

This only affects the elevation of a layer (whether it is drawn over or under other views).

Brings the given view to the front of the stack.

Pushes the given view to the back of the stack.

Moves a layer to a new position on the screen.

Has no effect on fullscreen layers Has no effect if layer is not found

Background drawing

Drawing functions are split into forground and background to ease inserting layers under the stackview but above it's background you probably just want to call draw()

Forground drawing

Drawing functions are split into forground and background to ease inserting layers under the stackview but above it's background you probably just want to call draw()

Trait Implementations

impl Default for StackView
[src]

Returns the "default value" for a type. Read more

impl View for StackView
[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

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

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

This view is offered focus. Will it take it? 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

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

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

Auto Trait Implementations

impl !Send for StackView

impl !Sync for StackView