summaryrefslogtreecommitdiffstats
path: root/pure/src/widget.rs
diff options
context:
space:
mode:
Diffstat (limited to 'pure/src/widget.rs')
-rw-r--r--pure/src/widget.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/pure/src/widget.rs b/pure/src/widget.rs
index 02bf3a85..8df64426 100644
--- a/pure/src/widget.rs
+++ b/pure/src/widget.rs
@@ -6,6 +6,7 @@ mod element;
mod row;
mod scrollable;
mod text;
+mod text_input;
mod tree;
pub use button::Button;
@@ -16,6 +17,7 @@ pub use element::Element;
pub use row::Row;
pub use scrollable::Scrollable;
pub use text::Text;
+pub use text_input::TextInput;
pub use tree::Tree;
use iced_native::event::{self, Event};
@@ -127,3 +129,15 @@ where
{
Checkbox::new(is_checked, label, f)
}
+
+pub fn text_input<'a, Message, Renderer>(
+ placeholder: &str,
+ value: &str,
+ on_change: impl Fn(String) -> Message + 'a,
+) -> TextInput<'a, Message, Renderer>
+where
+ Message: Clone,
+ Renderer: iced_native::text::Renderer,
+{
+ TextInput::new(placeholder, value, on_change)
+}