[−][src]Struct cursive_core::views::ScreensView
A view that can switch between different screens.
Implementations
impl<V> ScreensView<V>
[src]
pub fn new() -> Self
[src]
Creates a new empty ScreensView
.
pub fn single_screen(v: V) -> Self
[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]
V: View,
type V = V
Type that this view wraps.
fn with_view<F, R>(&self, f: F) -> Option<R> where
F: FnOnce(&Self::V) -> R,
[src]
F: FnOnce(&Self::V) -> R,
fn with_view_mut<F, R>(&mut self, f: F) -> Option<R> where
F: FnOnce(&mut Self::V) -> R,
[src]
F: FnOnce(&mut Self::V) -> R,
fn into_inner(self) -> Result<Self::V, Self> where
Self: Sized,
Self::V: Sized,
[src]
Self: Sized,
Self::V: Sized,
fn wrap_draw(&self, printer: &Printer)
[src]
fn wrap_required_size(&mut self, req: Vec2) -> Vec2
[src]
fn wrap_on_event(&mut self, ch: Event) -> EventResult
[src]
fn wrap_layout(&mut self, size: Vec2)
[src]
fn wrap_take_focus(&mut self, source: Direction) -> bool
[src]
fn wrap_call_on_any<'a>(&mut self, selector: &Selector, callback: AnyCb<'a>)
[src]
fn wrap_focus_view(&mut self, selector: &Selector) -> Result<(), ()>
[src]
fn wrap_needs_relayout(&self) -> bool
[src]
fn wrap_important_area(&self, size: Vec2) -> Rect
[src]
Auto Trait Implementations
impl<V> RefUnwindSafe for ScreensView<V> where
V: RefUnwindSafe,
V: RefUnwindSafe,
impl<V> Send for ScreensView<V> where
V: Send,
V: Send,
impl<V> Sync for ScreensView<V> where
V: Sync,
V: Sync,
impl<V> Unpin for ScreensView<V> where
V: Unpin,
V: Unpin,
impl<V> UnwindSafe for ScreensView<V> where
V: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Erased for T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,