Am 2008-10-20 um 16:15 schrieb Nate Lowrie:
> I have done this several times. The most important thing that I can
> say is in your thread which is running the long task, never have any
> lines of code that set the properties of UI widgets.  You will get a
> strange error if you try to set them outside a WX event thread.  I was
> trying to find an email on the wxPython list from Cory Percord that
> gave a more technical description of what happens, but I can't seem to
> locate it.  Instead, update a variable in the long task thread.  In
> the main UI thread call an update function that reads the variable and
> updates the progress bar.  You can do this a couple of ways.  First,
> you can use dabo.ui.callAfterInterval and a stop flag.  You can also
> use the onIdle event.  Or you can fire your own Dabo event from the
> long task thread.  They are all about the same amount of work, though
> the last one is more eloquent than the rest.

In such cases I used pyDispatcher events for the inter-thread  
communication.
I guess dEvents can do the same.
That seemed to be the cleanest approach.


Greetlings from Lake Constance!
Hraban
---
http://www.fiee.net
https://www.cacert.org (I'm an assurer)






_______________________________________________
Post Messages to: Dabo-users@leafe.com
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