A single-line text input. See input().
Super class
Widget -> Input
Public fields
paint_statesCursor and selection changes only repaint.
focusableInputs can be focused.
placeholderText shown while the input is empty.
passwordShow bullets instead of the characters?
max_lengthMaximum number of characters, or
NULL.validateNULLorfunction(value)returningNULL(valid) or an error message.
Active bindings
valueThe text (reactive). Assigning moves the cursor to the end and sends
"input.changed".cursor_positionCursor position in characters (0 = start).
selectionThe selected text (
""if none).validDoes the value pass
validate?errorThe validation message, or
NULL.
Methods
Inherited methods
Widget$add_class()Widget$ancestors()Widget$animate()Widget$arrange_children()Widget$bind()Widget$bind_reactive()Widget$bindings()Widget$blur()Widget$capture_mouse()Widget$child_clip()Widget$computed_style()Widget$content_height()Widget$focus()Widget$format()Widget$get_state()Widget$has_class()Widget$invalidate()Widget$invalidate_paint()Widget$is_displayed()Widget$is_enabled()Widget$layout_descend()Widget$layout_differs()Widget$matches()Widget$mount()Widget$on()Widget$paint()Widget$post_message()Widget$print()Widget$query()Widget$query_one()Widget$refresh()Widget$release_mouse()Widget$remove()Widget$remove_children()Widget$remove_class()Widget$render()Widget$replace()Widget$run_action()Widget$run_process()Widget$run_worker()Widget$set()Widget$set_interval()Widget$set_state()Widget$set_timeout()Widget$toggle_class()Widget$walk()
Input$new()
Create an input.
Usage
Input$new(
value = "",
placeholder = "",
id = NULL,
classes = NULL,
style = NULL,
disabled = FALSE,
password = FALSE,
max_length = NULL,
validate = NULL
)Arguments
valueInitial text.
placeholderPlaceholder text.
id, classes, style, disabledSee Widget.
passwordMask the characters?
max_lengthMaximum number of characters.
validateValidation function.
Input$on_key()
Printable keys replace the selection or are inserted at the cursor. Ctrl+C / Ctrl+X copy / cut when text is selected (otherwise Ctrl+C keeps its app meaning).
Input$on_paste()
Pasted text is inserted as one edit. An Input is a single line, so line breaks in the paste become spaces.
Input$copy()
Copy the selection to the app clipboard (and, when
system = TRUE and supported, to the system clipboard via OSC 52).
Input$render_lines()
The visible part of the text, scrolled so the cursor is visible, with the cursor drawn in reverse video and the selection highlighted when focused.