Joe232
April 25, 2022, 1:47pm
1
Hey guys I wanted to design my own custom widgets using the GUI library iced:
https://iced.rs/
I wanted to specifically draw a custom circle which serves as a button, but I am not too sure how or where would I get started to create my own widgets, any ideas?
I went here:
But now what do I do if I import Widget
?
Joe232
April 26, 2022, 4:05pm
2
impl<'a, Message> NumericInput<'a, Message> {
pub fn new(
state: &'a mut State,
value: Option<u32>,
on_change: impl Fn(Option<u32>) -> Message + 'static,
) -> Self {
Self {
state,
value,
on_change: Box::new(on_change),
}
}
}
DecrementPressed,
}
impl<Message> NumericInput<Message> {
pub fn new(
value: Option<u32>,
on_change: impl Fn(Option<u32>) -> Message + 'static,
) -> Self {
Self {
value,
on_change: Box::new(on_change),
}
}
}
impl<Message, Renderer> Component<Message, Renderer> for NumericInput<Message>
where
Renderer: iced_native::text::Renderer + 'static,
Renderer::Theme: widget::button::StyleSheet
+ widget::text_input::StyleSheet
+ widget::text::StyleSheet,
I believe I have to use this or something but I am not sure how any of this works?
system
Closed
July 25, 2022, 4:34pm
4
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.