Struct cursive::views::HideableView [−][src]
pub struct HideableView<V> { /* fields omitted */ }
Wrapper around another view that can be hidden at will.
By default, it simply forwards all calls to the inner view.
When hidden (with HideableView::hide()
), it will appear as a zero-sized
invisible view, will not take focus and will not accept input.
It can be made visible again with HideableView::unhide()
.
Methods
impl<V> HideableView<V>
[src]
impl<V> HideableView<V>
pub fn new(view: V) -> Self
[src]
pub fn new(view: V) -> Self
Creates a new HideableView around view
.
It will be visible by default.
pub fn set_visible(&mut self, visible: bool)
[src]
pub fn set_visible(&mut self, visible: bool)
Sets the visibility for this view.
pub fn hide(&mut self)
[src]
pub fn hide(&mut self)
Sets the visibility for this view to false
.
pub fn unhide(&mut self)
[src]
pub fn unhide(&mut self)
Sets the visibility for this view to true
.
Sets the visibility for this view to false
.
Chainable variant.
ⓘImportant traits for &'a mut Rpub fn get_inner(&self) -> &V
[src]
pub fn get_inner(&self) -> &V
Gets access to the inner view.
ⓘImportant traits for &'a mut Rpub fn get_inner_mut(&mut self) -> &mut V
[src]
pub fn get_inner_mut(&mut self) -> &mut V
Gets mutable access to the inner view.
Trait Implementations
impl<V: View> ViewWrapper for HideableView<V>
[src]
impl<V: View> ViewWrapper for HideableView<V>
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]
fn with_view<F, R>(&self, f: F) -> Option<R> where
F: FnOnce(&Self::V) -> R,
Runs a function on the inner view, returning the result. Read more
fn with_view_mut<F, R>(&mut self, f: F) -> Option<R> where
F: FnOnce(&mut Self::V) -> R,
[src]
fn with_view_mut<F, R>(&mut self, f: F) -> Option<R> where
F: FnOnce(&mut Self::V) -> R,
Runs a function on the inner view, returning the result. Read more
fn wrap_call_on_any<'a>(
&mut self,
selector: &Selector,
callback: Box<FnMut(&mut Any) + 'a>
)
[src]
fn wrap_call_on_any<'a>(
&mut self,
selector: &Selector,
callback: Box<FnMut(&mut Any) + 'a>
)
Wraps the find
method.
fn into_inner(self) -> Result<Self::V, Self> where
Self: Sized,
Self::V: Sized,
[src]
fn into_inner(self) -> Result<Self::V, Self> where
Self: Sized,
Self::V: Sized,
Attempts to retrieve the inner view.
fn wrap_draw(&self, printer: &Printer)
[src]
fn wrap_draw(&self, printer: &Printer)
Wraps the draw
method.
fn wrap_required_size(&mut self, req: Vec2) -> Vec2
[src]
fn wrap_required_size(&mut self, req: Vec2) -> Vec2
Wraps the required_size
method.
fn wrap_on_event(&mut self, ch: Event) -> EventResult
[src]
fn wrap_on_event(&mut self, ch: Event) -> EventResult
Wraps the on_event
method.
fn wrap_layout(&mut self, size: Vec2)
[src]
fn wrap_layout(&mut self, size: Vec2)
Wraps the layout
method.
fn wrap_take_focus(&mut self, source: Direction) -> bool
[src]
fn wrap_take_focus(&mut self, source: Direction) -> bool
Wraps the take_focus
method.
fn wrap_focus_view(&mut self, selector: &Selector) -> Result<(), ()>
[src]
fn wrap_focus_view(&mut self, selector: &Selector) -> Result<(), ()>
Wraps the focus_view
method.
fn wrap_needs_relayout(&self) -> bool
[src]
fn wrap_needs_relayout(&self) -> bool
Wraps the needs_relayout
method.
fn wrap_important_area(&self, size: Vec2) -> Rect
[src]
fn wrap_important_area(&self, size: Vec2) -> Rect
Wraps the important_area
method.
Auto Trait Implementations
impl<V> Send for HideableView<V> where
V: Send,
impl<V> Send for HideableView<V> where
V: Send,
impl<V> Sync for HideableView<V> where
V: Sync,
impl<V> Sync for HideableView<V> where
V: Sync,