summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Aaron Honeycutt <aaronhoneycutt@proton.me>2023-03-14 14:39:26 -0600
committerLibravatar Aaron Honeycutt <aaronhoneycutt@proton.me>2023-03-14 14:39:26 -0600
commitc96ab27b24a5775aeef7d8a0ed31214a5cb3f0a7 (patch)
treea4e30fdf0fd8fafa03446dc9170955aca118772a
parent6d9cf0b60198e7d6c9615f539dac4b06eada5851 (diff)
downloadiced-c96ab27b24a5775aeef7d8a0ed31214a5cb3f0a7.tar.gz
iced-c96ab27b24a5775aeef7d8a0ed31214a5cb3f0a7.tar.bz2
iced-c96ab27b24a5775aeef7d8a0ed31214a5cb3f0a7.zip
Work on example more
Diffstat (limited to '')
-rw-r--r--examples/radio/src/main.rs19
1 files changed, 7 insertions, 12 deletions
diff --git a/examples/radio/src/main.rs b/examples/radio/src/main.rs
index 3baccbe2..424fdf42 100644
--- a/examples/radio/src/main.rs
+++ b/examples/radio/src/main.rs
@@ -25,7 +25,7 @@ impl Sandbox for Example {
}
fn title(&self) -> String {
- String::from("Checkbox - Iced")
+ String::from("Radio - Iced")
}
fn update(&mut self, message: Message) {
@@ -36,17 +36,12 @@ impl Sandbox for Example {
}
fn view(&self) -> Element<Message> {
- let default_checkbox =
- checkbox("Default", self.default_checkbox, Message::DefaultChecked);
- let custom_checkbox =
- checkbox("Custom", self.custom_checkbox, Message::CustomChecked)
- .icon(checkbox::Icon {
- font: ICON_FONT,
- code_point: '\u{e901}',
- size: None,
- });
-
- let content = column![default_checkbox, custom_checkbox].spacing(22);
+ let selected_choice = Some(Choice::A);
+
+ Radio::new(Choice::A, "This is A", selected_choice, Message::RadioSelected);
+ Radio::new(Choice::B, "This is B", selected_choice, Message::RadioSelected);
+
+ let content = column![selected_choice].spacing(22);
container(content)
.width(Length::Fill)