diff options
author | 2022-04-25 16:33:07 -0700 | |
---|---|---|
committer | 2022-04-25 16:33:07 -0700 | |
commit | 70d290b2dcea4be270903c2f83686cd00dbd23a2 (patch) | |
tree | c27bf4596df871eafefc3cac60c4c2f53ec66d60 /examples/pure | |
parent | bba4cf323b711fe9a962c84d1a14875a0e394396 (diff) | |
download | iced-70d290b2dcea4be270903c2f83686cd00dbd23a2.tar.gz iced-70d290b2dcea4be270903c2f83686cd00dbd23a2.tar.bz2 iced-70d290b2dcea4be270903c2f83686cd00dbd23a2.zip |
add example
Diffstat (limited to 'examples/pure')
-rw-r--r-- | examples/pure/component/src/main.rs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/examples/pure/component/src/main.rs b/examples/pure/component/src/main.rs index b38d6fca..6d5a3b9c 100644 --- a/examples/pure/component/src/main.rs +++ b/examples/pure/component/src/main.rs @@ -1,6 +1,7 @@ use iced::pure::container; use iced::pure::{Element, Sandbox}; use iced::{Length, Settings}; +use iced_lazy::pure::responsive; use numeric_input::numeric_input; @@ -38,11 +39,14 @@ impl Sandbox for Component { } fn view(&self) -> Element<Message> { - container(numeric_input(self.value, Message::NumericInputChanged)) - .padding(20) - .height(Length::Fill) - .center_y() - .into() + responsive(|_| { + container(numeric_input(self.value, Message::NumericInputChanged)) + .padding(20) + .height(Length::Fill) + .center_y() + .into() + }) + .into() } } |