简体   繁体   中英

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 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM