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]
fn new() -> Self
Creates a new empty StackView
fn add_fullscreen_layer<T>(&mut self, view: T) where
T: 'static + View,
T: 'static + View,
Adds a new full-screen layer on top of the stack.
Fullscreen layers have no shadow.
fn add_layer<T>(&mut self, view: T) where
T: 'static + View,
T: 'static + View,
Adds new view on top of the stack in the center of the screen.
fn layer<T>(self, view: T) -> Self where
T: 'static + View,
T: 'static + View,
Adds new view on top of the stack in the center of the screen.
Chainable variant.
fn fullscreen_layer<T>(self, view: T) -> Self where
T: 'static + View,
T: 'static + View,
Adds a new full-screen layer on top of the stack.
Chainable variant.
fn add_layer_at<T>(&mut self, position: Position, view: T) where
T: 'static + View,
T: 'static + View,
Adds a view on top of the stack.
fn layer_at<T>(self, position: Position, view: T) -> Self where
T: 'static + View,
T: 'static + View,
Adds a view on top of the stack.
Chainable variant.
fn pop_layer(&mut self)
Remove the top-most layer.
fn offset(&self) -> Vec2
Computes the offset of the current top view.
fn layer_sizes(&self) -> Vec<Vec2>
Returns the size for each layer in this view.
Trait Implementations
impl Default for StackView
[src]
impl View for StackView
[src]
fn draw(&self, printer: &Printer)
Draws the view with the given printer (includes bounds) and focus.
fn on_event(&mut self, event: Event) -> EventResult
Called when a key was pressed. Read more
fn layout(&mut self, size: Vec2)
Called once the size for this view has been decided, Read more
fn required_size(&mut self, size: Vec2) -> Vec2
Returns the minimum size the view requires with the given restrictions. Read more
fn take_focus(&mut self, source: Direction) -> bool
This view is offered focus. Will it take it? Read more
fn call_on_any<'a>(
&mut self,
selector: &Selector,
callback: Box<FnMut(&mut Any) + 'a>
)
&mut self,
selector: &Selector,
callback: Box<FnMut(&mut Any) + 'a>
)
Runs a closure on the view identified by the given selector. Read more
fn focus_view(&mut self, selector: &Selector) -> Result<(), ()>
Moves the focus to the view identified by the given selector. Read more
fn needs_relayout(&self) -> bool
Returns true
if the view content changed since last layout phase. Read more