-
How can I define the let app = App::new().unwrap();
app.on_close_requested(||{
// code
slint::CloseRequestResponse::HideWindow
}); Here is the documentation - https://snapshots.slint.dev/master/docs/rust/slint/struct.window#method.on_close_requested |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You're trying to call In #6027, I proposed to better name these things. |
Beta Was this translation helpful? Give feedback.
You're trying to call
on_close_requested()
on the Rust struct the Slint compiler generates for you that implements theComponentHandle
trait. But you first have to call that trait'swindow()
function to retrieve the associated host window struct, calledWindow
.In #6027, I proposed to better name these things.
window()
andWindow
, e.g., could be namedhost_window()
/host()
andHostWindow
.ComponentHandle
could be namedWindowComponent
.