summaryrefslogtreecommitdiffstats
path: root/examples/multi_window
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2025-02-11 10:36:45 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2025-02-11 10:36:45 +0100
commiteab723866e1dc94ebd6d7c5c0c3ef191c80bcf59 (patch)
tree2b5a476f9da5155fd13e68957a9bbf3e3ab352a1 /examples/multi_window
parent080db348495f6e92f13391d3b222c5a2769b5fc1 (diff)
downloadiced-eab723866e1dc94ebd6d7c5c0c3ef191c80bcf59.tar.gz
iced-eab723866e1dc94ebd6d7c5c0c3ef191c80bcf59.tar.bz2
iced-eab723866e1dc94ebd6d7c5c0c3ef191c80bcf59.zip
Replace `with` function with `Function` trait
Diffstat (limited to 'examples/multi_window')
-rw-r--r--examples/multi_window/src/main.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/examples/multi_window/src/main.rs b/examples/multi_window/src/main.rs
index f9021c8d..8cec9d4c 100644
--- a/examples/multi_window/src/main.rs
+++ b/examples/multi_window/src/main.rs
@@ -3,7 +3,9 @@ use iced::widget::{
text_input,
};
use iced::window;
-use iced::{Center, Element, Fill, Subscription, Task, Theme, Vector};
+use iced::{
+ Center, Element, Fill, Function, Subscription, Task, Theme, Vector,
+};
use std::collections::BTreeMap;
@@ -169,7 +171,7 @@ impl Window {
let scale_input = column![
text("Window scale factor:"),
text_input("Window Scale", &self.scale_input)
- .on_input(move |msg| { Message::ScaleInputChanged(id, msg) })
+ .on_input(Message::ScaleInputChanged.with(id))
.on_submit(Message::ScaleChanged(
id,
self.scale_input.to_string()
@@ -179,7 +181,7 @@ impl Window {
let title_input = column![
text("Window title:"),
text_input("Window Title", &self.title)
- .on_input(move |msg| { Message::TitleChanged(id, msg) })
+ .on_input(Message::TitleChanged.with(id))
.id(format!("input-{id}"))
];