pub struct RadioButton { /* private fields */ }
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
}
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