pub struct RadioButtonGroup<T> { /* private fields */ }Available on crate feature
winio only.Expand description
A group of RadioButton. Only one of them could be checked.
Implementations§
Source§impl<'a, T> RadioButtonGroup<T>where
T: AsMut<[&'a mut RadioButton]>,
impl<'a, T> RadioButtonGroup<T>where
T: AsMut<[&'a mut RadioButton]>,
Sourcepub fn new(radios: T) -> RadioButtonGroup<T>
pub fn new(radios: T) -> RadioButtonGroup<T>
Create RadioButtonGroup.
Examples found in repository?
examples/test/widgets.rs (line 156)
155 async fn start(&mut self, sender: &ComponentSender<Self>) -> ! {
156 let mut radio_group = RadioButtonGroup::new([&mut *self.r1, &mut self.r2, &mut self.r3]);
157 start! {
158 sender, default: MainMessage::Noop,
159 self.window => {
160 WindowEvent::Close => MainMessage::Close,
161 WindowEvent::Resize => MainMessage::Redraw,
162 },
163 self.pcheck => {
164 CheckBoxEvent::Click => MainMessage::PasswordCheck,
165 },
166 self.combo => {
167 ComboBoxEvent::Select => MainMessage::Select,
168 },
169 self.push_button => {
170 ButtonEvent::Click => MainMessage::Push,
171 },
172 self.pop_button => {
173 ButtonEvent::Click => MainMessage::Pop,
174 },
175 self.show_button => {
176 ButtonEvent::Click => MainMessage::Show,
177 },
178 self.list => {
179 e => MainMessage::List(e),
180 },
181 radio_group => {
182 |i| Some(MainMessage::RSelect(i))
183 }
184 }
185 }Auto Trait Implementations§
impl<T> Freeze for RadioButtonGroup<T>where
T: Freeze,
impl<T> RefUnwindSafe for RadioButtonGroup<T>where
T: RefUnwindSafe,
impl<T> Send for RadioButtonGroup<T>where
T: Send,
impl<T> Sync for RadioButtonGroup<T>where
T: Sync,
impl<T> Unpin for RadioButtonGroup<T>where
T: Unpin,
impl<T> UnwindSafe for RadioButtonGroup<T>where
T: UnwindSafe,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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