Struct cursive::views::TextView
[−]
[src]
pub struct TextView { // some fields omitted }
A simple view showing a fixed text
Methods
impl TextView
[src]
fn new<S: Into<String>>(content: S) -> Self
Creates a new TextView with the given content.
fn set_scrollable(&mut self, scrollable: bool)
Enable or disable the view's scrolling capabilities.
When disabled, the view will never attempt to scroll (and will always ask for the full height).
fn scrollable(self, scrollable: bool) -> Self
Enable or disable the view's scrolling capabilities.
When disabled, the view will never attempt to scroll (and will always ask for the full height).
Chainable variant.
fn h_align(self, h: HAlign) -> Self
Sets the horizontal alignment for this view.
fn v_align(self, v: VAlign) -> Self
Sets the vertical alignment for this view.
fn align(self, a: Align) -> Self
Sets the alignment for this view.
fn center(self) -> Self
Center the text horizontally and vertically inside the view.
fn set_content<S: Into<String>>(&mut self, content: S)
Replace the text in this view.
fn get_content(&self) -> &str
Returns the current text in this view.
Trait Implementations
impl View for TextView
[src]
fn draw(&self, printer: &Printer)
Draws the view with the given printer (includes bounds) and focus.
fn on_event(&mut self, event: Event) -> EventResult
Called when a key was pressed. Default implementation just ignores it.
fn needs_relayout(&self) -> bool
Returns true
if the view content changed since last layout phase. Read more
fn get_min_size(&mut self, size: Vec2) -> Vec2
Returns the minimum size the view requires with the given restrictions. Read more
fn take_focus(&mut self, _: Direction) -> bool
This view is offered focus. Will it take it? Read more
fn layout(&mut self, size: Vec2)
Called once the size for this view has been decided, Read more
fn find(&mut self, &Selector) -> Option<&mut Any>
Finds the view pointed to by the given path. Read more