cosmic::iced_widgetFunction button
source pub fn button<'a, Message, Theme, Renderer>(
content: impl Into<Element<'a, Message, Theme, Renderer>>,
) -> Button<'a, Message, Theme, Renderer>
Expand description
Creates a new Button
with the provided content.
ยงExample
use iced::widget::button;
#[derive(Clone)]
enum Message {
ButtonPressed,
}
fn view(state: &State) -> Element<'_, Message> {
button("Press me!").on_press(Message::ButtonPressed).into()
}