[gcompris-devel] help! canvas refresh

Bruno Coudoin bruno.coudoin at free.fr
Tue Dec 23 23:56:05 UTC 2003


Perhaps we should add a callback associated with a sound. This callback
would be called when the sound is completly played. I had poor success
with this kind of thing because it would mean a thread calling back the
main. Not sure GTK supports that. It is when I wrote the music info
popup window. It worked but could mess thinks up easily for example when
exiting board during the popup display.

For you, the best is to move the play of the audio in the show_bang
function and your done.

Bruno.

Le mer 24/12/2003 à 08:14, José JORGE a écrit :
> This shows something, I'll explore how to play sound exactly when cursor has 
> moved.
> 
> Thanks Bruno
> 
> José
> 
> Em Terça, 23 de Dezembro de 2003 23:31, o Bruno Coudoin escreveu:
> > def show_bang(self, a):
> >     print "show_bang a="+str(a)
> >     if a==1:
> >       self.bang_item.set(x=150,y=50)
> >     elif a==2:
> >       self.bang_item.set(x=550,y=50)
> >     elif a==3:
> >       self.bang_item.set(x=150,y=250)
> >     else :
> >       self.bang_item.set(x=550,y=250)
> >    
> >            
> >   def repeat(self):
> >     print("Gcompris_melody repeat.")
> >     #self.bang_item.show()
> >     timer = 0
> >     for a in self.solution[:]:
> >       gcompris.sound.play_ogg("melody/son"+str(self.a))
> >       self.show_bang_timer = gtk.timeout_add(timer, self.show_bang, a)
> >       timer = timer + 1000





More information about the Gcompris-devel mailing list