Struct egui::widgets::radio_button::RadioButton
source · pub struct RadioButton {
checked: bool,
text: WidgetText,
}
Expand description
One out of several alternatives, either selected or not.
Usually you’d use Ui::radio_value
or Ui::radio
instead.
#[derive(PartialEq)]
enum Enum { First, Second, Third }
let mut my_enum = Enum::First;
ui.radio_value(&mut my_enum, Enum::First, "First");
// is equivalent to:
if ui.add(egui::RadioButton::new(my_enum == Enum::First, "First")).clicked() {
my_enum = Enum::First
}
Fields§
§checked: bool
§text: WidgetText
Implementations§
source§impl RadioButton
impl RadioButton
pub fn new(checked: bool, text: impl Into<WidgetText>) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RadioButton
impl RefUnwindSafe for RadioButton
impl Send for RadioButton
impl Sync for RadioButton
impl Unpin for RadioButton
impl UnwindSafe for RadioButton
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more