Douglas Buchanan wrote:
> I am (hopefully) at the end of a long, arduous process of creating a progress 
> dialog that updates while other threads are running and doing the work. The 
> last hang-up I have occurs in this snippet of code:
>
> __workerThread = ReportWorkerThread(SendReport, args)
> __workerThread.start()
> while __workerThread.isAlive():
>   dabo.ui.yieldUI()
>   if __workerThread == None:
>     break
>   if __workerThread != None:
>     if __workerThread._status != 'OK':
>       return
>
> The issue is that once dabo.ui.yieldUI is called in the code above, it has 
> the desired effect of allowing the worker thread the ability to post events 
> that are received by the progress dialog (dDialog), but the call into yieldUI 
> never returns until the dForm that this code is called from is closed. Is 
> there a better way to refresh/repaint the UI while the thread is processing? 
> The sad thing is that this works correctly on Windows, but on Linux it does 
> not.
>   

Doug,

I have done a few apps that use this approach.  Basically, I have an 
intermediary object that handles all of the status fields I want to 
update.  The worker thread will periodically set the status fields.  I 
then have the UI thread (main thread) update the status every so often 
through a dabo.ui.callAfterInterval call.  The status is updated by 
reading the status fields on the object.  This is a pretty streamlined 
approach and the UI should be smooth and responsive.

Regards,

Nate
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[email protected]

Reply via email to