Expand description
Create and run iced applications step by step.
§Example
use iced::widget::{button, column, text, Column};
use iced::Theme;
pub fn main() -> iced::Result {
iced::application("A counter", update, view)
.theme(|_| Theme::Dark)
.centered()
.run()
}
#[derive(Debug, Clone)]
enum Message {
Increment,
}
fn update(value: &mut u64, message: Message) {
match message {
Message::Increment => *value += 1,
}
}
fn view(value: &u64) -> Column<Message> {
column![
text(value),
button("+").on_press(Message::Increment),
]
}
Structs§
- The underlying definition and configuration of an iced application.
Traits§
- The title logic of some
Application
. - The update logic of some
Application
. - The view logic of some
Application
.
Functions§
- Creates an iced
Application
given its title, update, and view logic.