How does one programmatically close a window? #2688
-
Having a few issues with winnit but pretty new to Rust. Major issue I'm having currently is I'm trying to encapsulate the API and one thing I want to be able to do is close the application. If the app is full screen I may want to put a button on screen that closes the whole application. I can't find any method to support such an operation which .... is odd from every other window API i've ever worked with. I found a few titles saying 'we already support it but there is no close method' which ... also seemed weird to me. What is the winit way to close a window? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You {
let window = Window::new(...);
// <- The window is dropped here, when going out of scope.
} |
Beta Was this translation helpful? Give feedback.
You
Drop
it, like you do with most other stuff inRust
or languages doingRAII
.