Basically there is a block of data which is retrieved from a server which the UI needs in order to function. In the event that the data needs to be retrieved from the server, I display a window with a loading message and a wxGauge set to indeterminate mode.
Of course the actual work is done in a thread, but I need the data in order to proceed, so I wait for it...in the UI thread...
the LRT runtime basically looks like this
Code: Select all
MyTask task;
while(!task.iscomplete()){
wxyield();
sleep_ms(25);
}
return task.data;
the gauge is set to pulse on a timer and works fine in other instances.
Bind(wxEVT_TIMER, [&](wxTimerEvent&) {m_gauge->Pulse(); }, m_timer.GetId());
Am I not using wxyield correctly or something?
The only reason I even bother asking is because I know that I have seen this work. IIRC it was working right up until I switched from gtk3 to gtk2.
I am also aware that this is not the proper way to handle this situation, but realistically, this is an edge case that isnt likely to ever appear in the wild.