diff options
Diffstat (limited to 'examples/combo_box/src/main.rs')
-rw-r--r-- | examples/combo_box/src/main.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/examples/combo_box/src/main.rs b/examples/combo_box/src/main.rs index fcf5feaa..2feb4522 100644 --- a/examples/combo_box/src/main.rs +++ b/examples/combo_box/src/main.rs @@ -1,10 +1,10 @@ use iced::widget::{ column, combo_box, container, scrollable, text, vertical_space, }; -use iced::{Alignment, Element, Length, Sandbox, Settings}; +use iced::{Alignment, Element, Length}; pub fn main() -> iced::Result { - Example::run(Settings::default()) + iced::run("Combo Box - Iced", Example::update, Example::view) } struct Example { @@ -20,9 +20,7 @@ enum Message { Closed, } -impl Sandbox for Example { - type Message = Message; - +impl Example { fn new() -> Self { Self { languages: combo_box::State::new(Language::ALL.to_vec()), @@ -31,10 +29,6 @@ impl Sandbox for Example { } } - fn title(&self) -> String { - String::from("Combo box - Iced") - } - fn update(&mut self, message: Message) { match message { Message::Selected(language) => { @@ -83,6 +77,12 @@ impl Sandbox for Example { } } +impl Default for Example { + fn default() -> Self { + Example::new() + } +} + #[derive(Debug, Clone, Copy, PartialEq, Eq, Default)] pub enum Language { Danish, |