pub struct TextInput { /* private fields */ }Expand description
A single-line text input widget with cursor and editing support.
Implementations§
Source§impl TextInput
impl TextInput
Sourcepub const fn with_config(bounds: Rect, config: TextInputConfig) -> Self
pub const fn with_config(bounds: Rect, config: TextInputConfig) -> Self
Create a new text input widget with custom configuration.
Sourcepub fn set_content(&mut self, content: &str)
pub fn set_content(&mut self, content: &str)
Set the content, moving cursor to end.
Sourcepub const fn set_focused(&mut self, focused: bool)
pub const fn set_focused(&mut self, focused: bool)
Set focus state.
Sourcepub const fn is_focused(&self) -> bool
pub const fn is_focused(&self) -> bool
Check if focused.
Trait Implementations§
Source§impl Widget for TextInput
impl Widget for TextInput
Source§fn set_bounds(&mut self, bounds: Rect)
fn set_bounds(&mut self, bounds: Rect)
Set the bounds of this widget. Read more
Source§fn handle_input(&mut self, event: &InputEvent) -> bool
fn handle_input(&mut self, event: &InputEvent) -> bool
Handle an input event. Read more
Source§fn needs_redraw(&self) -> bool
fn needs_redraw(&self) -> bool
Check if this widget needs to be redrawn.
Source§fn clear_redraw(&mut self)
fn clear_redraw(&mut self)
Clear the redraw flag after rendering.
Auto Trait Implementations§
impl Freeze for TextInput
impl RefUnwindSafe for TextInput
impl Send for TextInput
impl Sync for TextInput
impl Unpin for TextInput
impl UnwindSafe for TextInput
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more