Introduce Program API
This commit is contained in:
parent
0524e9b457
commit
c22269bff3
43 changed files with 1141 additions and 831 deletions
|
|
@ -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) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue