summaryrefslogtreecommitdiffstats
path: root/examples/clock
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-04-19 14:39:30 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-04-19 14:39:30 +0200
commit0b5028b1ab47707a469176e9bf20cacdd3a19861 (patch)
treeba4ea88bbb5e3d3ebf22699a758c30181f535b35 /examples/clock
parent90c3a183d5e79aee1f323991c8c45161ccf9e187 (diff)
downloadiced-0b5028b1ab47707a469176e9bf20cacdd3a19861.tar.gz
iced-0b5028b1ab47707a469176e9bf20cacdd3a19861.tar.bz2
iced-0b5028b1ab47707a469176e9bf20cacdd3a19861.zip
Draft `Program` interactivity for `Canvas`
Diffstat (limited to 'examples/clock')
-rw-r--r--examples/clock/src/main.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/clock/src/main.rs b/examples/clock/src/main.rs
index 827379fa..2407db65 100644
--- a/examples/clock/src/main.rs
+++ b/examples/clock/src/main.rs
@@ -59,10 +59,9 @@ impl Application for Clock {
}
fn view(&mut self) -> Element<Message> {
- let canvas = Canvas::new()
+ let canvas = Canvas::new(&mut self.clock, &self.now)
.width(Length::Units(400))
- .height(Length::Units(400))
- .push(self.clock.with(&self.now));
+ .height(Length::Units(400));
Container::new(canvas)
.width(Length::Fill)