[][src]Struct cursive::views::ScreensView

pub struct ScreensView<V = BoxedView> { /* fields omitted */ }

A view that can switch between different screens.

Implementations

impl<V> ScreensView<V>[src]

pub fn new() -> ScreensView<V>[src]

Creates a new empty ScreensView.

pub fn single_screen(v: V) -> ScreensView<V>[src]

Creates a new ScreensView with a single screen.

pub fn screen(&self) -> Option<&V>[src]

Returns a reference to the currently active screen.

Returns None if there is no active screen.

pub fn screen_mut(&mut self) -> Option<&mut V>[src]

Returns a mutable reference to the currently active screen.

pub fn active_screen(&self) -> usize[src]

Returns the id of the currently active screen.

pub fn add_screen(&mut self, v: V) -> usize[src]

Adds a new screen, and returns its ID.

pub fn add_active_screen(&mut self, v: V) -> usize[src]

Convenient method to create a new screen, and set it as active.

pub fn set_active_screen(&mut self, screen_id: usize)[src]

Sets the active screen. Panics if no such screen exist.

impl ScreensView<StackView>[src]

pub fn draw_bg(&self, printer: &Printer<'_, '_>)[src]

Draws the background.

This is mostly used internally by cursive. You probably just want View::draw.

pub fn draw_fg(&self, printer: &Printer<'_, '_>)[src]

Draws the foreground.

This is mostly used internally by cursive. You probably just want View::draw.

Trait Implementations

impl<V> Default for ScreensView<V>[src]

impl<V> ViewWrapper for ScreensView<V> where
    V: View
[src]

type V = V

Type that this view wraps.

Auto Trait Implementations

impl<V> RefUnwindSafe for ScreensView<V> where
    V: RefUnwindSafe
[src]

impl<V> Send for ScreensView<V> where
    V: Send
[src]

impl<V> Sync for ScreensView<V> where
    V: Sync
[src]

impl<V> Unpin for ScreensView<V> where
    V: Unpin
[src]

impl<V> UnwindSafe for ScreensView<V> where
    V: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> AnyView for T where
    T: View
[src]

pub fn as_any(&self) -> &(dyn Any + 'static)[src]

Downcast self to a Any.

pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)[src]

Downcast self to a mutable Any.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Erased for T

impl<T> Finder for T where
    T: View
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoBoxedView for T where
    T: View
[src]

impl<T> Nameable for T where
    T: View
[src]

impl<T> Resizable for T where
    T: View
[src]

impl<T> Scrollable for T where
    T: View
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> View for T where
    T: ViewWrapper
[src]

impl<T> With for T[src]