Skip to content

How does one programmatically close a window? #2688

Answered by kchibisov
ChaseLewis asked this question in Q&A
Discussion options

You must be logged in to vote

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?

You Drop it, like you do with most other stuff in Rust or languages doing RAII.

{
  let window = Window::new(...);

  // <- The …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kchibisov
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