From 80c8f1a1a90b3f636e46c53988557cd02d247584 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Fri, 28 Feb 2020 13:43:29 -0500 Subject: [PATCH] Parity with original tutorial --- src/main.rs | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index ccc2c18..abceea6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -22,6 +22,35 @@ impl Default for AboutDialog { } } +impl Component for AboutDialog { + type Message = (); + type Properties = (); + + fn view(&self) -> VNode { + gtk! { + , + DialogFlags::MODAL, + &[("Ok", ResponseType::Ok)] + )> + + + + + } + } +} + +impl AboutDialog { + #[allow(unused_must_use)] + fn run() { + vgtk::run_dialog::(vgtk::current_window().as_ref()); + } +} + #[derive(Clone, Debug, Default)] pub struct Radio { pub labels: &'static [&'static str], @@ -203,7 +232,10 @@ impl Component for Model { self.tasks.retain(|task| !task.done); UpdateAction::Render } - Message::About => UpdateAction::None, + Message::About => { + AboutDialog::run(); + UpdateAction::None + } } }