Skip to content

Latest commit

 

History

History
36 lines (26 loc) · 983 Bytes

adding_widgets.md

File metadata and controls

36 lines (26 loc) · 983 Bytes

Adding Widgets

Use column! and row! to group multiple widgets such as text and button.

use iced::widget::{button, column, row, Column, text};

pub fn main() -> iced::Result {
    iced::application("My app", update, view).run()
}

#[derive(Debug, Clone)]

enum Message {
    _Increment,
}

fn update(_value: &mut u64, _message: Message) {
}

fn view(_value: &u64) -> Column<Message> {
    column![
        text("Yes or No?"),
        row!(
            button("Yes"),
            button("No")
        )
    ].into()
}

Adding widgets

➡️ Next: Changing Displaying Content

📘 Back: Table of contents