[−][src]Struct iced::widget::radio::Radio
A circular button representing a choice, with a generic text Color
.
It implements Widget
when the associated Renderer
implements the
radio::Renderer
trait.
Example
use iced::{Column, Radio}; #[derive(Debug, Clone, Copy)] pub enum Color { Black, } #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum Choice { A, B, } #[derive(Debug, Clone, Copy)] pub enum Message { RadioSelected(Choice), } let selected_choice = Some(Choice::A); Radio::new(Choice::A, "This is A", selected_choice, Message::RadioSelected) .label_color(Color::Black); Radio::new(Choice::B, "This is B", selected_choice, Message::RadioSelected) .label_color(Color::Black);
Methods
impl<Color, Message> Radio<Color, Message>
[src]
pub fn new<F, V>(value: V, label: &str, selected: Option<V>, f: F) -> Self where
V: Eq + Copy,
F: 'static + Fn(V) -> Message,
[src]
V: Eq + Copy,
F: 'static + Fn(V) -> Message,
Creates a new Radio
button.
It expects:
pub fn label_color(self, color: Color) -> Self
[src]
Sets the Color
of the label of the Radio
.
Trait Implementations
impl<Color, Message, Renderer> Widget<Message, Renderer> for Radio<Color, Message> where
Color: 'static + Copy + Debug,
Renderer: Renderer + Renderer<Color>,
Message: Copy + Debug,
[src]
Color: 'static + Copy + Debug,
Renderer: Renderer + Renderer<Color>,
Message: Copy + Debug,
fn node(&self, renderer: &Renderer) -> Node
[src]
fn on_event(
&mut self,
event: Event,
layout: Layout,
cursor_position: Point,
messages: &mut Vec<Message>
)
[src]
&mut self,
event: Event,
layout: Layout,
cursor_position: Point,
messages: &mut Vec<Message>
)
fn draw(
&self,
renderer: &mut Renderer,
layout: Layout,
cursor_position: Point
) -> MouseCursor
[src]
&self,
renderer: &mut Renderer,
layout: Layout,
cursor_position: Point
) -> MouseCursor
fn hash_layout(&self, state: &mut Hasher)
[src]
impl<'a, Color, Message, Renderer> From<Radio<Color, Message>> for Element<'a, Message, Renderer> where
Color: 'static + Copy + Debug,
Renderer: Renderer + Renderer<Color>,
Message: 'static + Copy + Debug,
[src]
Color: 'static + Copy + Debug,
Renderer: Renderer + Renderer<Color>,
Message: 'static + Copy + Debug,
impl<Color, Message> Debug for Radio<Color, Message> where
Color: Debug,
Message: Debug,
[src]
Color: Debug,
Message: Debug,
Auto Trait Implementations
impl<Color, Message> Sync for Radio<Color, Message> where
Color: Sync,
Message: Sync,
Color: Sync,
Message: Sync,
impl<Color, Message> Send for Radio<Color, Message> where
Color: Send,
Message: Send,
Color: Send,
Message: Send,
impl<Color, Message> Unpin for Radio<Color, Message> where
Color: Unpin,
Message: Unpin,
Color: Unpin,
Message: Unpin,
impl<Color, Message> UnwindSafe for Radio<Color, Message> where
Color: UnwindSafe,
Message: UnwindSafe,
Color: UnwindSafe,
Message: UnwindSafe,
impl<Color, Message> RefUnwindSafe for Radio<Color, Message> where
Color: RefUnwindSafe,
Message: RefUnwindSafe,
Color: RefUnwindSafe,
Message: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,