pub struct TextField<State> { /* private fields */ }
Expand description
A text field is a view that the user can enter text into.
Implementations§
source§impl<State> TextField<State>
impl<State> TextField<State>
sourcepub fn new(text: impl Into<StateOrRaw<String>>) -> Self
pub fn new(text: impl Into<StateOrRaw<String>>) -> Self
sourcepub fn set_on_change(
&mut self,
action: impl Fn(&mut State, String, Window) + 'static
)
pub fn set_on_change( &mut self, action: impl Fn(&mut State, String, Window) + 'static )
Get notified when the text is changed.
sourcepub fn with_on_change(
self,
action: impl Fn(&mut State, String, Window) + 'static
) -> Self
pub fn with_on_change( self, action: impl Fn(&mut State, String, Window) + 'static ) -> Self
Get notified when the text is changed.
sourcepub fn with_placeholder(
self,
placeholder: impl Into<StateOrRaw<String>>
) -> Self
pub fn with_placeholder( self, placeholder: impl Into<StateOrRaw<String>> ) -> Self
Set the placeholder of the field, which is displayed when the field is empty (the user has no text entered (yet)).
sourcepub fn set_placeholder(&mut self, placeholder: impl Into<StateOrRaw<String>>)
pub fn set_placeholder(&mut self, placeholder: impl Into<StateOrRaw<String>>)
Set the placeholder of the field, which is displayed when the field is empty (the user has no text entered (yet)).
Trait Implementations§
source§impl<Delegate, State> From<TextField<State>> for Box<dyn View<Delegate, State>>where
Delegate: AppDelegate<State> + 'static,
State: 'static,
impl<Delegate, State> From<TextField<State>> for Box<dyn View<Delegate, State>>where
Delegate: AppDelegate<State> + 'static,
State: 'static,
impl<Delegate, State> View<Delegate, State> for TextField<State>where
Delegate: 'static + AppDelegate<State>,
State: 'static,
Auto Trait Implementations§
impl<State> !RefUnwindSafe for TextField<State>
impl<State> !Send for TextField<State>
impl<State> !Sync for TextField<State>
impl<State> Unpin for TextField<State>
impl<State> !UnwindSafe for TextField<State>
Blanket Implementations§
source§impl<T> BaseViewExt for Twhere
T: BaseView,
impl<T> BaseViewExt for Twhere
T: BaseView,
source§fn set_tooltip(&mut self, tooltip: impl Into<StateOrRaw<String>>)
fn set_tooltip(&mut self, tooltip: impl Into<StateOrRaw<String>>)
Set the tooltip of the view, which is text that is commonly displayed
when hovering over a component (such as a button). This is used to
provide the user with more context, or to let them know what the action
will do.
source§fn with_tooltip(self, tooltip: impl Into<StateOrRaw<String>>) -> T
fn with_tooltip(self, tooltip: impl Into<StateOrRaw<String>>) -> T
Set the tooltip of the view, which is text that is commonly displayed
when hovering over a component (such as a button). This is used to
provide the user with more context, or to let them know what the action
will do.
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