summaryrefslogtreecommitdiffstats
path: root/examples/scroll.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-11-17 07:09:46 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-11-17 07:11:44 +0100
commit02c20e6202f1c8c28753f3233cc635790707937a (patch)
treeb13ec79b938a6000709d1241ac1344724386c77a /examples/scroll.rs
parente640b875900a3833fd38efa195e99b40ec3f6820 (diff)
downloadiced-02c20e6202f1c8c28753f3233cc635790707937a.tar.gz
iced-02c20e6202f1c8c28753f3233cc635790707937a.tar.bz2
iced-02c20e6202f1c8c28753f3233cc635790707937a.zip
Support async actions in `iced_winit`
Diffstat (limited to 'examples/scroll.rs')
-rw-r--r--examples/scroll.rs14
1 files changed, 10 insertions, 4 deletions
diff --git a/examples/scroll.rs b/examples/scroll.rs
index 50701879..61ad2a53 100644
--- a/examples/scroll.rs
+++ b/examples/scroll.rs
@@ -1,12 +1,12 @@
use iced::{
- button, scrollable, Align, Application, Button, Container, Element, Image,
- Length, Scrollable, Text,
+ button, scrollable, Align, Application, Button, Command, Container,
+ Element, Image, Length, Scrollable, Text,
};
pub fn main() {
env_logger::init();
- Example::default().run()
+ Example::run()
}
#[derive(Default)]
@@ -25,16 +25,22 @@ pub enum Message {
impl Application for Example {
type Message = Message;
+ fn new() -> (Example, Command<Message>) {
+ (Example::default(), Command::none())
+ }
+
fn title(&self) -> String {
String::from("Scroll - Iced")
}
- fn update(&mut self, message: Message) {
+ fn update(&mut self, message: Message) -> Command<Message> {
match message {
Message::AddItem => {
self.item_count += 1;
}
}
+
+ Command::none()
}
fn view(&mut self) -> Element<Message> {