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 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.

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