I've implemented a progress dialog derived from wxDialog which makes a pretty good progress bar so far with short bursts of activity interspersed with a lot of:
Code: Select all
wxSafeYield(this)
Code: Select all
while( !this->WasClosed() )
{
this->Yield();
Sleep(1);
}
It looks like I could alleviate this problem by implementing wxEventLoopBase and using wxEventLoopActivator.
Unfortunately, I can't find any implementations of wxEventLoopBase or uses of wxEventLoopActivator in the wx samples I have. Implementing wxEventLoopBase seems non-trivial as my compiler keeps telling me my wxEventLoopBase derived class is abstract even though I've already stubbed about 8 functions I've no clue how to implement properly.
Is there an easier way to turn a wxDialog modal after already having displayed it with Show()?
Is there a better approach? (progress dialog for single long thread which pauses at the end to wait for close)
Right now my application is entirely single threaded and I'd like to keep it that way for simplicity.