So, I want to create a window from another window to ask user to view a list and select one of three buttons (actions/responses). I’ve created a markup of the window and it looks good.
The problem is getting the response out of the window. I see that documentation Dialog in gtk4 - Rust mentions that Dialog is deprecated and Window should be used instead. But unfortunately I didn’t find and have not figured out how to emit a response (there’s no “response” in the keywords of what IDE suggests me and (almost) nothing in the documentation). I can provide more details if needed.
Basically I want something like (this is a working example using AdwAlertDialog)
let alert = adw::AlertDialog::new();
alert.connect_response(None, move |_, response| {
match response {
"no" => do_this(),
"yes" => do_that(),
_ => {}
}
});
but with a Window. Is this possible? If not, what are workarounds?
Crates info (built with gvsbuild):
adw = { version = "0.8", package = "libadwaita", features = ["v1_5"] }
gtk = { version = "0.10.0", package = "gtk4", features = ["v4_14"] }