I need to create a one button, modal alert with a progress bar - but I’m having some issues with this.
First, the documentation for AlertWindow::showMessageBoxAsync doesn’t correspond to the actual code. It tells me to pass a callback parameter if I want callbacks - but that parameter doesn’t exist - how you can do anything useful with a showMessageBoxAsync without a callback?
Second, I don’t see how to actually get my hands on the AlertWindow to add a progress bar if I use the convenience methods (which I’d love to).
I’m creating an AlertWindow directly, which is probably the simplest way around it - but I’m curious as to how showMessageBoxAsync could be used, and I’m pretty sure that the documentation needs a tweak or two…
I’d seen runModalLoop and ThreadWithProgressWindow, and they don’t quite fit the bill (though I can make 'em do what I want).
What’s happening is that there’s a thread that’s already running in the background. When the user requests a save, if that thread hasn’t finished calculation, I want to bring up a progress bar. That task can’t be a “ThreadWithProgressWindow” because nearly all the time there’s no progress window…
But of course you’re right that I’m blocking the message thread, so there needs to be a new thread somewhere - might as well be a ThreadWithProgressWindow.
I asked that second half of the question when I was pretty sleepy - still fairly sure that AlertWindow::showMessageBoxAsync is snafu’ed, at the very least because the documentation doesn’t match the actual code…!