[][src]Struct cursive::views::TextArea

pub struct TextArea { /* fields omitted */ }

Multi-lines text editor.

A TextArea will attempt to grow vertically and horizontally dependent on the content. Wrap it in a BoxView to constrain its size.

Methods

impl TextArea[src]

pub fn new() -> Self[src]

Creates a new, empty TextArea.

pub fn get_content(&self) -> &str[src]

Retrieves the content of the view.

pub fn cursor(&self) -> usize[src]

Returns the position of the cursor in the content string.

pub fn set_cursor(&mut self, cursor: usize)[src]

Moves the cursor to the given position.

Panics

This method panics if cursor is not the beginning of a character in the content string.

pub fn set_content<S: Into<String>>(&mut self, content: S)[src]

Sets the content of the view.

pub fn content<S: Into<String>>(self, content: S) -> Self[src]

Sets the content of the view.

Chainable variant.

pub fn disable(&mut self)[src]

Disables this view.

A disabled view cannot be selected.

pub fn disabled(self) -> Self[src]

Disables this view.

Chainable variant.

pub fn enable(&mut self)[src]

Re-enables this view.

pub fn enabled(self) -> Self[src]

Re-enables this view.

Chainable variant.

pub fn is_enabled(&self) -> bool[src]

Returns true if this view is enabled.

Trait Implementations

impl View for TextArea[src]

fn needs_relayout(&self) -> bool[src]

Should return true if the view content changed since the last call to layout(). Read more

fn call_on_any<'a>(&mut self, _: &Selector, _: AnyCb<'a>)[src]

Runs a closure on the view identified by the given selector. Read more

fn focus_view(&mut self, _: &Selector) -> Result<(), ()>[src]

Moves the focus to the view identified by the given selector. Read more

impl Default for TextArea[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[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> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T[src]