PyGTK: Controlling interface from within joined thread
I have a thread in PyGTK, inside my mainloop. It's a Timer, so it needed to be joined with .join(). The problem is, I now cannot edit my UI from in that thread - change text and so on - because of the .join(). Is there a way I can change things from outside (well, you know what I mean) the开发者_如何学Python mainloop?
Thanks.
instead of using a Timer thread, use glib.timeout_add
to do your thing.
It works together with gtk's mainloop and runs in the same thread, so you don't have to do anything special.
精彩评论