[][src]Struct cursive::views::OnLayoutView

pub struct OnLayoutView<V> { /* fields omitted */ }

View wrapper overriding the View::layout method.

Implementations

impl<V> OnLayoutView<V>[src]

pub fn new<F>(view: V, on_layout: F) -> OnLayoutView<V> where
    F: FnMut(&mut V, XY<usize>) + 'static, 
[src]

Wraps a view in an OnLayoutView.

Will run the given closure for layout instead of the one from view.

use cursive_core::{
    views::{OnLayoutView, TextView},
    View,
};

let view = TextView::new("foo");

// Here we just run the innver view's layout.
OnLayoutView::new(view, |v, s| v.layout(s));

pub fn wrap(view: V) -> OnLayoutView<V> where
    V: View
[src]

Wraps a view in an OnLayoutView.

This is a shortcut for Self::new(view, V::layout)

You can change it later with set_on_layout.

pub fn set_on_layout<F>(&mut self, on_layout: F) where
    F: FnMut(&mut V, XY<usize>) + 'static, 
[src]

Replaces the callback to run.

pub fn get_inner(&self) -> &V[src]

Gets access to the inner view.

pub fn get_inner_mut(&mut self) -> &mut V[src]

Gets mutable access to the inner view.

Trait Implementations

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

type V = V

Type that this view wraps.

Auto Trait Implementations

impl<V> !RefUnwindSafe for OnLayoutView<V>[src]

impl<V> !Send for OnLayoutView<V>[src]

impl<V> !Sync for OnLayoutView<V>[src]

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

impl<V> !UnwindSafe for OnLayoutView<V>[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]