Skip to main content

EditsText

Trait EditsText 

Source
pub trait EditsText: Widget {
    // Required methods
    fn show_text(&mut self, obj: ObjId);
    fn hide_text(&mut self);
    fn take_edited(&mut self) -> Option<String>;
    fn reset_text(&mut self, text: &str);
    fn shown_text(&self) -> &str;
}
Expand description

A text control a TextControl drives: it shows the text object it is bound to and keeps the user’s edits local, for its owner to submit.

Required Methods§

Source

fn show_text(&mut self, obj: ObjId)

Show the text object obj, reading it on every sync, and keep edits out of the document.

Source

fn hide_text(&mut self)

Stop showing a text object.

Source

fn take_edited(&mut self) -> Option<String>

The text after the user’s edits since the last call, if any.

Source

fn reset_text(&mut self, text: &str)

Show text, which is not a user edit.

Source

fn shown_text(&self) -> &str

The text shown.

Implementors§