I’m trying to assign EventControllerKey to the AlertDialog,
but it does not react (even for any key press):
alert_dialog.add_controller({
let c = gtk::EventControllerKey::builder().build();
c.connect_key_pressed({
let alert_dialog = alert_dialog.clone();
move |_, k, _, _| {
alert_dialog.close(); // on k == code
gtk::glib::Propagation::Stop
}
});
c
});