Struct cursive::views::TrackedView [−][src]
pub struct TrackedView<T: View> { pub view: T, // some fields omitted }
Wrapper around a view that remembers its position.
Fields
view: T
Wrapped view.
Methods
impl<T: View> TrackedView<T>
[src]
impl<T: View> TrackedView<T>
pub fn offset(&self) -> Vec2
[src]
pub fn offset(&self) -> Vec2
Return the last offset at which the view was drawn.
pub fn new(view: T) -> Self
[src]
pub fn new(view: T) -> Self
Creates a new TrackedView
around view
.
pub fn with_id(self, id: &str) -> IdView<Self>
[src]
pub fn with_id(self, id: &str) -> IdView<Self>
Wraps itself in a IdView
for easy retrieval.
ⓘImportant traits for &'a mut Rpub fn get_inner(&self) -> &T
[src]
ⓘImportant traits for &'a mut R
pub fn get_inner(&self) -> &T
Gets access to the inner view.
ⓘImportant traits for &'a mut Rpub fn get_inner_mut(&mut self) -> &mut T
[src]
ⓘImportant traits for &'a mut R
pub fn get_inner_mut(&mut self) -> &mut T
Gets mutable access to the inner view.
Trait Implementations
impl<T: View> ViewWrapper for TrackedView<T>
[src]
impl<T: View> ViewWrapper for TrackedView<T>
type V = T
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 into_inner(self) -> Result<Self::V, Self> where
Self::V: Sized,
[src]
fn into_inner(self) -> Result<Self::V, Self> where
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_call_on_any<'a>(&mut self, selector: &Selector, callback: AnyCb<'a>)
[src]
fn wrap_call_on_any<'a>(&mut self, selector: &Selector, callback: AnyCb<'a>)
Wraps the find
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<T> Send for TrackedView<T> where
T: Send,
impl<T> Send for TrackedView<T> where
T: Send,
impl<T> !Sync for TrackedView<T>
impl<T> !Sync for TrackedView<T>