Tkinter and asyncronous socket

Hendrik van Rooyen mail at microcorp.co.za
Fri Nov 28 14:32:30 EST 2008


 "Eric Brunel" <see.signature at no.spam> wrote

>You don't need to in fact: from the secondary thread, it seems to be safe  
>to post a user-defined event in the GUI event loop on which you can set a  
>binding in the GUI thread. This allows a thread switch without having to  
>do a periodical check.
>
8< ---------------- example -------------

>The custom event '<<heartbeat>>' is posted in the event loop from the  
>secondary thread. Note the when='tail' option, which is absolutely  
>necessary or the binding might be called immediatly without even an actual  
>event posting. The binding on this event will then be executed in the  
>thread that launched the mainloop.


Cunning stuff - I was not aware of this either.

I hope we are not confusing the newbie....

- Hendrik




More information about the Python-list mailing list