summaryrefslogtreecommitdiffstats
path: root/examples/lazy
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-03-16 05:33:47 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-03-16 05:33:47 +0100
commitc22269bff3085012d326a0df77bf27ad5bcb41b7 (patch)
tree1083f21d012ab2bac88fb51537d4dc431bc7f170 /examples/lazy
parent0524e9b4571d264018656418f02a1f9e27e268d7 (diff)
downloadiced-c22269bff3085012d326a0df77bf27ad5bcb41b7.tar.gz
iced-c22269bff3085012d326a0df77bf27ad5bcb41b7.tar.bz2
iced-c22269bff3085012d326a0df77bf27ad5bcb41b7.zip
Introduce `Program` API
Diffstat (limited to 'examples/lazy')
-rw-r--r--examples/lazy/src/main.rs16
1 files changed, 3 insertions, 13 deletions
diff --git a/examples/lazy/src/main.rs b/examples/lazy/src/main.rs
index 8758fa66..2d53df93 100644
--- a/examples/lazy/src/main.rs
+++ b/examples/lazy/src/main.rs
@@ -2,13 +2,13 @@ use iced::widget::{
button, column, horizontal_space, lazy, pick_list, row, scrollable, text,
text_input,
};
-use iced::{Element, Length, Sandbox, Settings};
+use iced::{Element, Length};
use std::collections::HashSet;
use std::hash::Hash;
pub fn main() -> iced::Result {
- App::run(Settings::default())
+ iced::run("Lazy - Iced", App::update, App::view)
}
struct App {
@@ -120,17 +120,7 @@ enum Message {
ItemColorChanged(Item, Color),
}
-impl Sandbox for App {
- type Message = Message;
-
- fn new() -> Self {
- Self::default()
- }
-
- fn title(&self) -> String {
- String::from("Lazy - Iced")
- }
-
+impl App {
fn update(&mut self, message: Message) {
match message {
Message::InputChanged(input) => {