summaryrefslogtreecommitdiffstats
path: root/examples/lazy/src
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector@hecrj.dev>2024-03-16 17:09:00 +0100
committerLibravatar GitHub <noreply@github.com>2024-03-16 17:09:00 +0100
commit503a48e89977437bf8b7bf485f416a15a2e83ed0 (patch)
tree30306bbaee7a31090ace9d7725d46c2c0027fe6b /examples/lazy/src
parent0524e9b4571d264018656418f02a1f9e27e268d7 (diff)
parentcfc0383bbfff083786840e3f1fd499e5991fa629 (diff)
downloadiced-503a48e89977437bf8b7bf485f416a15a2e83ed0.tar.gz
iced-503a48e89977437bf8b7bf485f416a15a2e83ed0.tar.bz2
iced-503a48e89977437bf8b7bf485f416a15a2e83ed0.zip
Merge pull request #2331 from iced-rs/program-api
`Program` API
Diffstat (limited to 'examples/lazy/src')
-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) => {