Skip to content

Using on_close_requested callback for Window #6828

Answered by Enyium
mrandal asked this question in Q&A
Discussion options

You must be logged in to vote

You're trying to call on_close_requested() on the Rust struct the Slint compiler generates for you that implements the ComponentHandle trait. But you first have to call that trait's window() function to retrieve the associated host window struct, called Window.

In #6027, I proposed to better name these things. window() and Window, e.g., could be named host_window()/host() and HostWindow. ComponentHandle could be named WindowComponent.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mrandal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants