Struct cursive::view::TextView
[−]
[src]
pub struct TextView { // some fields omitted }
A simple view showing a fixed text
Methods
impl TextView
[src]
fn new(content: &str) -> Self
Creates a new TextView with the given content.
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 set_content(&mut self, content: &str)
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(&mut 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 get_min_size(&self, size: SizeRequest) -> Vec2
Returns the minimum size the view requires under the given restrictions.
fn take_focus(&mut self) -> bool
This view is offered focus. Will it take it?
fn layout(&mut self, size: Vec2)
Called once the size for this view has been decided, so it can propagate the information to its children. Read more
fn find(&mut self, &Selector) -> Option<&mut Any>
Finds the view pointed to by the given path. Returns None if the path doesn't lead to a view. Read more