Struct orbtk::text_box::TextBox [] [src]

pub struct TextBox {
    pub core: WidgetCore,
    pub text: CloneCell<String>,
    pub text_i: Cell<usize>,
    pub fg_cursor: Color,
    pub mask_char: Cell<Option<char>>,
    pub grab_focus: Cell<bool>,
    pub on_click: RefCell<Option<Arc<Fn(&TextBox, Point)>>>,
    pub on_enter: RefCell<Option<Arc<Fn(&TextBox)>>>,
    pub event_filter: RefCell<Option<Arc<Fn(&TextBox, Event, &mut bool, &mut bool) -> Option<Event>>>>,
    // some fields omitted
}

Fields

If event_filter is defined, all of the events will go trough it Instead of the default behavior. This allows defining fields that ex. will only accept numbers and ignore all else, or add some special behavior for some keys.

The closure should return None if the event was manually handled, or should return the event it received if it wants the default handler deal with it.

Methods

impl TextBox
[src]

Trait Implementations

impl Click for TextBox
[src]

impl Enter for TextBox
[src]

impl Placeable for TextBox
[src]

impl EventFilter for TextBox
[src]

impl Widget for TextBox
[src]