Multi-threading and PyGTK
The "easiest" way of integrating threads with PyGTK applications seems to be by using gobject.
Initialisation before starting the GTK main loop:
import gobject
gobject.threads_init()
Schedule any rendering functions from your thread with:
gobject.idle_add(window.queue_draw)
Also useful is the timeout_add function, which schedules periodic callbacks:
gobject.timeout_add(250, window.queue_draw)
Comments [6]