Struct termimad::InputField[][src]

pub struct InputField {
    pub area: Area,
    pub focused: bool,
    // some fields omitted
}
Expand description

A simple input field, managing its cursor position and either handling the events you give it or being managed through direct manipulation functions (put_char, del_char_left, etc.)

Fields

area: Areafocused: bool

Implementations

tell whether the content of the input is equal to the argument

change the content to the new one and put the cursor at the end if the content is different from the previous one.

put a char at cursor position (and increment this position)

remove the char left of the cursor, if any

remove the char at cursor position, if any

delete the word rigth of the cursor.

apply an event being a key without modifier.

You don’t usually call this function but the more general apply_event. This one is useful when you manage events mostly yourselves.

This function handles a few events like deleting a char, or going to the start (home key) or end (end key) of the input. If you want to totally handle events, you may call function like put_char and del_char_left directly.

apply a click event

(for when you handle the events yourselves and don’t have a termimad event)

apply the passed event to change the state (content, cursor)

Return true when the event was used.

render the input field on screen.

All rendering must be explicitely called, no rendering is done on functions changing the state.

w is typically either stderr or stdout.

render the input field on stdout

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.