pub struct TextInput { /* private fields */ }Expand description
A single-line text field.
Fires change on every edit and submit on Enter. Left, Right, Home,
End, Backspace and Delete move and edit; a click places the caret.
Implementations§
Source§impl TextInput
impl TextInput
Trait Implementations§
Source§impl<M: 'static> Widget<M> for TextInput
impl<M: 'static> Widget<M> for TextInput
Source§fn set_attribute(&mut self, name: &str, value: &str) -> bool
fn set_attribute(&mut self, name: &str, value: &str) -> bool
Takes an attribute from the element description, returning
false
for one the widget does not know. id, class, style, grow,
align, disabled, shortcut and state never reach here.Source§fn measure(&self, fonts: &dyn Fonts, style: &ComputedStyle) -> Size
fn measure(&self, fonts: &dyn Fonts, style: &ComputedStyle) -> Size
The natural size of the widget’s own content, without padding or
border. Containers are measured from their children instead.
Source§fn state(&self) -> ElementState
fn state(&self) -> ElementState
State the widget owns, such as
CHECKED, merged into the element’s
state for styling.Source§fn event(&mut self, cx: &mut EventCx<'_, M>, event: &Event) -> bool
fn event(&mut self, cx: &mut EventCx<'_, M>, event: &Event) -> bool
Handles an event aimed at this element. Returning
true stops the
event from bubbling to the parent.Source§fn paint(&self, renderer: &mut dyn Renderer, cx: &PaintCx<'_>, content: Rect)
fn paint(&self, renderer: &mut dyn Renderer, cx: &PaintCx<'_>, content: Rect)
Paints the widget’s own content inside
content, after the
framework has painted the background and border and before it paints
the children.fn as_any(&self) -> &dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Auto Trait Implementations§
impl Freeze for TextInput
impl RefUnwindSafe for TextInput
impl Send for TextInput
impl Sync for TextInput
impl Unpin for TextInput
impl UnsafeUnpin 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