This post came up from code similar to the following. I have a FileDragAndDropTarget, which upon dropping a bunch of files, calls ThreadWithProgressWindow to do some time consuming stuff.
void MainComponent::filesDropped (const StringArray &files, int x, int y)
// do sth cpu intensive
const int thingsToDo = 100;
for (int i = 0; i < thingsToDo; ++i)
// this will update the progress bar on the dialog box
setProgress (i / (double) thingsToDo);
// ... do the business here...
Now, I understand that the above solution has a lot of problems (even when not taking into account the above comments). On Mac, Finder will just freeze -no rainbow wheels though- (which I believe is intended, since dropping a new bunch of files to the app, would try to call filesDropped, which hasn’t yet returned from the previous call).
Now the question becomes, How would you go with it?
Any help will be appreciated.
(Note: Using a CallbackMessage to start the ThreadWithProgressWindow later on doesn’t have any effect.)