summaryrefslogtreecommitdiffstats
path: root/examples/todos.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/todos.rs
parente640b875900a3833fd38efa195e99b40ec3f6820 (diff)
downloadiced-02c20e6202f1c8c28753f3233cc635790707937a.tar.gz
iced-02c20e6202f1c8c28753f3233cc635790707937a.tar.bz2
iced-02c20e6202f1c8c28753f3233cc635790707937a.zip
Support async actions in `iced_winit`
Diffstat (limited to 'examples/todos.rs')
-rw-r--r--examples/todos.rs14
1 files changed, 10 insertions, 4 deletions
diff --git a/examples/todos.rs b/examples/todos.rs
index f921a666..d97a9e08 100644
--- a/examples/todos.rs
+++ b/examples/todos.rs
@@ -1,11 +1,11 @@
use iced::{
button, scrollable, text::HorizontalAlignment, text_input, Align,
- Application, Background, Button, Checkbox, Color, Column, Container,
- Element, Font, Length, Row, Scrollable, Text, TextInput,
+ Application, Background, Button, Checkbox, Color, Column, Command,
+ Container, Element, Font, Length, Row, Scrollable, Text, TextInput,
};
pub fn main() {
- Todos::default().run()
+ Todos::run()
}
#[derive(Debug, Default)]
@@ -29,11 +29,15 @@ pub enum Message {
impl Application for Todos {
type Message = Message;
+ fn new() -> (Todos, Command<Message>) {
+ (Todos::default(), Command::none())
+ }
+
fn title(&self) -> String {
String::from("Todos - Iced")
}
- fn update(&mut self, message: Message) {
+ fn update(&mut self, message: Message) -> Command<Message> {
match message {
Message::InputChanged(value) => {
self.input_value = value;
@@ -58,6 +62,8 @@ impl Application for Todos {
}
dbg!(self);
+
+ Command::none()
}
fn view(&mut self) -> Element<Message> {