Is there any way to programmatically close the window ?
I'm evaluating the possibility to write a daemon that pops a window asking a question, then when the question is answered, the window must disappear without the user clicking the close button.
There is currently no way to do this.
It should be easily implementable (maybe as part of Mode?), but we need to keep in mind that Application::run will never return. Therefore, closing the main window will exit the whole process.
Opening and closing windows from the same process is something that we should explore when tackling #27.
While not being the best solution, i think it might be possible to currently do this by taking control of the event loop yourself. The integration example might be a good starting point, you would just need to remove the scene code from the example. You would then just call Window::set_visible to show and hide your dialog.
While not being the best solution, i think it might be possible to _currently_ do this by taking control of the event loop yourself. The integration example might be a good starting point, you would just need to remove the scene code from the example. You would then just call
Window::set_visibleto show and hide your dialog.
Thank you. Yes, this seems to be a good way to do it by now. Or to *set control_flow to ControlFlow::Exit, to end the application on certain user interactions.
There is currently no way to do this.
It should be easily implementable (maybe as part of
Mode?), but we need to keep in mind thatApplication::runwill never return. Therefore, closing the main window will exit the whole process.
Do you mean that Mode should have a variant like Unmapped or Invisible ? And we can just set this mode from the running code?
Opening and closing windows from the same process is something that we should explore when tackling #27.
This issue is somewhat related to #170. Maybe we should tackle both of them together.
Do you mean that Mode should have a variant like Unmapped or Invisible ?
Yes, I think an Invisible variant could work nicely.
And we can just set this mode from the running code?
The mode can be currently set in Application::mode.
Most helpful comment
While not being the best solution, i think it might be possible to currently do this by taking control of the event loop yourself. The integration example might be a good starting point, you would just need to remove the scene code from the example. You would then just call
Window::set_visibleto show and hide your dialog.