Ver Mensaje Individual
  #13 (permalink)  
Antiguo 03/05/2011, 20:05
_Adrian_
 
Fecha de Ingreso: septiembre-2010
Mensajes: 525
Antigüedad: 13 años, 7 meses
Puntos: 59
Hilos con Pygtk:
Código Python:
Ver original
  1. import threading
  2.  
  3. gtk.gdk.threads_init()
  4.  
  5. def animacion(self):
  6.    tupla = ("ruta_imagen_1","ruta_imagen_2","ruta_imagen_3")
  7.    for i in range(0,2):
  8.       sleep(0.05)
  9.       gtk.gdk.threads_enter()
  10.       self.gtkImage.set_from_file(self.tupla[i])
  11.       gtk.gdk.threads_leave()
  12.  
  13. def thread(self):
  14.    hilo = threading.Thread(target=animacion)
  15.    hilo.start()

Y cuando quieres mostrar la animación, llamas la función thread.

__________________
01011111 01000001 01100100 01110010 01101001 01100001 01101110 01011111