I have a working app but am trying to add a menu to it.
My very simple first steps
let b = Button::new( text("function").into())
.padding([4, 8])
.on_press(Message::Constant(Pi.name.to_string()))
;
let mb = MenuBar::new(vec![
Item::with_menu(b, menu!((text("a").into())(text("b").into())(text("c").into())))
]);
Fail with
262 | Item::with_menu(b, menu!((text("a").into())(text("b").into())(text("c").into())))
| --------------- ^ the trait `From<iced::widget::Button<'_, Message, _, _>>` is not implemented for `iced_core::element::Element<'_, _, _, _>`, which is required by `iced::widget::Button<'_, Message, _, _>: Into<iced_core::element::Element<'_, _, _, _>>`
| |
| required by a bound introduced by this call
I can’t see why, especially as I get the useful help from rustrover that
the following other types implement trait `From<T>`:
...
From<iced_widget::button::Button<'a, Message, Theme, Renderer>>>
...