summaryrefslogtreecommitdiffstats
path: root/examples/bezier_tool
diff options
context:
space:
mode:
Diffstat (limited to 'examples/bezier_tool')
-rw-r--r--examples/bezier_tool/src/main.rs21
1 files changed, 5 insertions, 16 deletions
diff --git a/examples/bezier_tool/src/main.rs b/examples/bezier_tool/src/main.rs
index 897e7df8..cf70bd40 100644
--- a/examples/bezier_tool/src/main.rs
+++ b/examples/bezier_tool/src/main.rs
@@ -1,12 +1,11 @@
//! 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::program("Bezier Tool - Iced", Example::update, Example::view)
+ .antialiasing(true)
+ .run()
}
#[derive(Default)]
@@ -21,17 +20,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) => {