Skip to main content

TextInput

Trait TextInput 

pub trait TextInput {
    // Required methods
    fn text(&self) -> Cow<'_, str>;
    fn move_cursor_to_front(&mut self);
    fn move_cursor_to_end(&mut self);
    fn move_cursor_to(&mut self, location: Position);
    fn select_all(&mut self);
    fn select_range(&mut self, start: Position, end: Position);
}
Available on crate feature advanced only.
Expand description

The internal state of a widget that has text input.

Required Methods§

fn text(&self) -> Cow<'_, str>

Returns the current visible text of the text input.

Normally, this is either its value or its placeholder.

fn move_cursor_to_front(&mut self)

Moves the cursor of the text input to the front of the input text.

fn move_cursor_to_end(&mut self)

Moves the cursor of the text input to the end of the input text.

fn move_cursor_to(&mut self, location: Position)

Moves the cursor of the text input to an arbitrary location.

fn select_all(&mut self)

Selects all the content of the text input.

fn select_range(&mut self, start: Position, end: Position)

Selects the given content range of the text input.

Implementors§

§

impl<R> TextInput for Input<R>
where R: Renderer,

§

impl<T> TextInput for T
where T: Editor,