Hide ThreadWithProgressWindow

Hey!

As the title says, is there anyway to hide the window sometimes with ThreadWithProgressWindow? I want to reuse the work done in my ThreadWithProgressWindow elsewhere but not show window.

getAlertWindow()->setVisible(false); doesn't seem to work...

Thanks!

Are you using the ThreadWithProgressWindow modally (i.e. using the ThreadWithProgressWindow::runThread method)? I’m not sure you can hide the alert window if the message thread is blocked by the modal window.

Hold on, is runThread modal and launchThread not? Because in the documentation it seems that launchThread is the one that has the modal state (I’m guessing they both are).

https://www.juce.com/doc/classThreadWithProgressWindow#adb0f85d0de1be635284b3606b02d1708

In any case there’s no way to initiate the ThreadWithProgressWindow silently? As in not even hide it but not have it in the first place?

Thanks!
C

Sorry, my answer was really confusing. runThread will block, where launchThread will return immediately. But you are right, both are modal.

Can you hide the window immediately after calling launchThread?

Actually, I just realised that you can call ThreadWithProgressWindow’s thread directly, without initiating runThread (using startThread).

This seems to work!

Thanks Fabian for your discussion.