[pygtk] Animation

Maximo Pech makzpj at gmail.com
Wed Oct 11 22:23:50 WST 2006


Hello, i'm new to pygtk and i'm trying to make a small animation using
gtk.Image but i can't. This is my code:

def animar(widget, lo_que_se_muestra):
        lo_que_se_muestra.set_from_pixbuf(frame1.get_pixbuf())
        lo_que_se_muestra.queue_draw()
        time.sleep(1)
        lo_que_se_muestra.set_from_pixbuf(frame2.get_pixbuf())

frame1 =3D gtk.Image()
frame2 =3D gtk.Image()

frame1.set_from_file('/mnt/usb1/avatar1.png')
frame2.set_from_file('/mnt/usb1/avatar2.png')

lo_que_se_muestra =3D gtk.Image()
bplay =3D gtk.Button('play')
bplay.connect('clicked', animar, lo_que_se_muestra)


The idea is to click the 'play' button, show the first frame, wait 1 second
and show the second frame, but what it is doing is wait 1 second without
showing nothing and then it shows only the last frame.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20061011/208da4ea/at=
tachment.htm


More information about the pygtk mailing list