Creating a stand alone project from the iced-aw context_menu example

Finally seemingly found a location where I might get help to get started with iced context menus.

I found a context_menu example in the iced-aw repository.

To be able to find out how to integrate it in my project I started by doing a stand alone project by copying the main.rs content and creating a cargo.toml file that with dependency to the appropriate iced crates and stating the [“context_menu”] feature for iced-aw.

I get the error message

    Checking iced-example-c v0.1.0 (C:\development\rust\gui-test\context_menue_test)
error[E0277]: the trait bound `Element<'_, _, _>: From<iced::widget::Container<'_, Message, _, _>>` is not satisfied
  --> src\main.rs:62:26
62 |         ContextMenu::new(underlay, || {
   |         ---------------- ^^^^^^^^ the trait `From<iced::widget::Container<'_, Message, _, _>>` is not implemented for `Element<'_, _, _>`, which is required by `iced::widget::Container<'_, Message, _, _>: Into<Element<'_, _, _>>`
   |         required by a bound introduced by this call 

What am I doing wrong ?

iced_aw isn’t compatible yet with the latest release.

I see.

in cargo.toml I have

[dependencies]
iced_aw = { version = "0.7.0", features = ["context_menu"] }
iced_runtime = "0.12.0"
iced = { version = "0.12.0", features = ["lazy"] }
iced_widget = "0.12.0"

Can I do anything about that or do I need to wait for updates ?

… trying to pull the most recent code…

now doing

[dependencies]
iced_aw = { path = "c:/development/rust/gui-test/iced_aw", features = [
    "context_menu",
] }
iced_runtime = "0.12.0"
iced = { version = "0.12.0", features = ["lazy"] }
iced_widget = "0.12.0"

works
… and I was able to integrate a context menu in my project that features many more widgets. :smile:

Thanks !