diff options
author | 2022-05-02 21:21:24 +0200 | |
---|---|---|
committer | 2022-05-02 21:21:24 +0200 | |
commit | 5acba65c1135d8ebbda94efc74ea0bebb29c438a (patch) | |
tree | 88673403313ad90cec226ee92d4ebf4ef0a24bdc /pure/src/widget/text_input.rs | |
parent | a17a7103d382f02c64e7b271d953ea6babffac97 (diff) | |
parent | 7e111f273fb22a6ffc7a4fd24bea5e838d276758 (diff) | |
download | iced-5acba65c1135d8ebbda94efc74ea0bebb29c438a.tar.gz iced-5acba65c1135d8ebbda94efc74ea0bebb29c438a.tar.bz2 iced-5acba65c1135d8ebbda94efc74ea0bebb29c438a.zip |
Merge pull request #1327 from iced-rs/update-docs
Update documentation
Diffstat (limited to 'pure/src/widget/text_input.rs')
-rw-r--r-- | pure/src/widget/text_input.rs | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/pure/src/widget/text_input.rs b/pure/src/widget/text_input.rs index d6041d7f..57ad26d9 100644 --- a/pure/src/widget/text_input.rs +++ b/pure/src/widget/text_input.rs @@ -1,3 +1,4 @@ +//! Display fields that can be filled with text. use crate::widget::tree::{self, Tree}; use crate::{Element, Widget}; @@ -15,20 +16,15 @@ pub use iced_style::text_input::{Style, StyleSheet}; /// /// # Example /// ``` -/// # use iced_native::renderer::Null; -/// # use iced_native::widget::text_input; -/// # -/// # pub type TextInput<'a, Message> = iced_native::widget::TextInput<'a, Message, Null>; +/// # pub type TextInput<'a, Message> = iced_pure::widget::TextInput<'a, Message, iced_native::renderer::Null>; /// #[derive(Debug, Clone)] /// enum Message { /// TextInputChanged(String), /// } /// -/// let mut state = text_input::State::new(); /// let value = "Some text"; /// /// let input = TextInput::new( -/// &mut state, /// "This is the placeholder...", /// value, /// Message::TextInputChanged, @@ -58,10 +54,9 @@ where /// Creates a new [`TextInput`]. /// /// It expects: - /// - some [`State`] - /// - a placeholder - /// - the current value - /// - a function that produces a message when the [`TextInput`] changes + /// - a placeholder, + /// - the current value, and + /// - a function that produces a message when the [`TextInput`] changes. pub fn new<F>(placeholder: &str, value: &str, on_change: F) -> Self where F: 'a + Fn(String) -> Message, @@ -86,10 +81,9 @@ where self } - /// Sets the [`Font`] of the [`Text`]. + /// Sets the [`Font`] of the [`TextInput`]. /// - /// [`Font`]: crate::widget::text::Renderer::Font - /// [`Text`]: crate::widget::Text + /// [`Font`]: iced_native::text::Renderer::Font pub fn font(mut self, font: Renderer::Font) -> Self { self.font = font; self |