diff options
Diffstat (limited to 'examples/bezier_tool/src/main.rs')
-rw-r--r-- | examples/bezier_tool/src/main.rs | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/examples/bezier_tool/src/main.rs b/examples/bezier_tool/src/main.rs index 897e7df8..1bd32e19 100644 --- a/examples/bezier_tool/src/main.rs +++ b/examples/bezier_tool/src/main.rs @@ -1,12 +1,12 @@ //! This example showcases an interactive `Canvas` for drawing Bézier curves. use iced::widget::{button, column, text}; -use iced::{Alignment, Element, Length, Sandbox, Settings}; +use iced::{Alignment, Element, Length}; pub fn main() -> iced::Result { - Example::run(Settings { - antialiasing: true, - ..Settings::default() - }) + iced::sandbox(Example::update, Example::view) + .title("Bezier tool - Iced") + .antialiased() + .run() } #[derive(Default)] @@ -21,17 +21,7 @@ enum Message { Clear, } -impl Sandbox for Example { - type Message = Message; - - fn new() -> Self { - Example::default() - } - - fn title(&self) -> String { - String::from("Bezier tool - Iced") - } - +impl Example { fn update(&mut self, message: Message) { match message { Message::AddCurve(curve) => { |