pub struct RadioButton<'a> { /* 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<'a> RadioButton<'a>
impl<'a> RadioButton<'a>
pub fn new(checked: bool, atoms: impl IntoAtoms<'a>) -> Self
Sourcepub fn atoms(&self) -> &Atoms<'a>
pub fn atoms(&self) -> &Atoms<'a>
Output the RadioButton’s Atoms.
This includes any images you have on the RadioButton.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for RadioButton<'a>
impl<'a> !Send for RadioButton<'a>
impl<'a> !Sync for RadioButton<'a>
impl<'a> !UnwindSafe for RadioButton<'a>
impl<'a> Freeze for RadioButton<'a>
impl<'a> Unpin for RadioButton<'a>
impl<'a> UnsafeUnpin for RadioButton<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more