is there a way to use AlertWindow without any buttons? The aim would be to show a message and block the UI asynchronously during some task and hide it programmatically when ready.
ATM this question seems to be about how to show an AlertWindow without runModalLoop.
If that task is a thread, you could use ThreadWithProgressWindow.
You can configure if the cancel button should be present or not.
If you have a look through the MessageBoxOptions, it should be possible to show any AlertWindow without any buttons.
Thanks for the suggestions. The task needs to run in the main loop, so ThreadWithProgressWindow is not an option.
The problem with message boxes is that i don’t know how to hide them programmatically.
The way i see this is that if i create an AlertWindow to get a reference to it, i can’t show it asynchronously. On the otherhand if i use the showMessageBoxAsync method, i don’t get a reference to the AlertWindow for dismissing it. I’m going through the documentation and can’t figure this out.
It might be easier to just roll my own message display and add it to the main view and remove it when done. Seems like a bit redundant class, but Juce seems too restricted to allow the use of AlertWindow for this kind of task.
I think an overlay component is indeed the best option, since it avoids all issues with windows getting stuck behind, modal etc.
FTR, the AlertWindow is closed if you delete it. Just put it into an std::unique_ptr, and to close call reset(). This doesn’t work with the static methods of course.