[gcompris-devel] howto implement a timer?

bruno bruno.coudoin at free.fr
Thu Mar 21 15:23:06 UTC 2002


Sound great, it brings an interresting new feature, we have not
investigated this even if some board would be better with this.

I suggest to use the repeat icon spot that we already have in the
toolbar for audio boards, to implement the "please help me" function.
gcompris_bar_set(GCOMPRIS_BAR_LEVEL|GCOMPRIS_BAR_OK|GCOMPRIS_BAR_REPEAT)
then implement a repeat callback
I assume there is no need to have a repeat icon and a "please help".
For now, if you need a button, you can use repeat like described here.

Bruno.


Le jeu 21/03/2002 à 21:39, Bastiaan Verhoef a écrit :
> hmmm.... I want to help the kids solving the maze.
> If they are unable to solve the maze. the computer can it. But i want
> that it goes slowly. Not directly the answer.
> 
> Op do 21-03-2002, om 19:44 schreef Bruno Coudoin:
> > In gcompris we use widely:
> > 
> > id = gtk_timeout_add (200,(GtkFunction) clickgame_drop_items, NULL);
> > 
> > gtk_timeout_remove (id);
> > 
> > 200 is in mili seconds, an example of usage is in clickgame.c
> > 
> > Are you planning another great feature for gcompris ;)
> > 
> > Something we miss is to be able to play animated png. Nobody never
> > looked at that, but it would make gcompris much more friendly.
> > Especially, Renaud already sent me the boat moving in the waves ;)
> > 
> > Bruno.
> > 
> > 
> > 
> > le jeu 21-03-2002 à 19:30, Bastiaan Verhoef a écrit :
> > > Sorry for this stupid question, but.
> > > 
> > > For example I want to draw  lines but animated. with a timer.
> > > I have a function draw_a_line.how can I do it?
> > > 
> > > int i;
> > > for( i=0;i<10;i++)
> > > {
> > > 	draw_a_line(my_canvas,i,i,i+2,i,"green");
> > > }
> > > 
> > > -----------------------------
> > > 
> > > static void
> > > draw_a_line(GnomeCanvasGroup *group,
> > > 	    int x1, int y1, int x2, int y2, char *color)
> > > {
> > > 	GnomeCanvasPoints *points;
> > > 
> > > 	points = gnome_canvas_points_new (2);
> > > 
> > > 	points->coords[0] = x1;
> > > 	points->coords[1] = y1;
> > > 	points->coords[2] = x2;
> > > 	points->coords[3] = y2;
> > > 	gnome_canvas_item_new(group,
> > > 			      gnome_canvas_line_get_type(),
> > > 			      "points", points,
> > > 			      "fill_color", color,
> > > 			      "width_units", (double)thickness,
> > > 			      NULL);
> > > 
> > > 	gnome_canvas_points_free(points);
> > > }
> > > 
> > > 
> > > 
> > > 
> > > _______________________________________________
> > > gcompris-devel mailing list
> > > gcompris-devel at lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/gcompris-devel
> > 
> > 
> > 
> > _______________________________________________
> > gcompris-devel mailing list
> > gcompris-devel at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/gcompris-devel
> > 
> 
> 






More information about the Gcompris-devel mailing list