Re: Help CPU usage at 8.9% ?



You are rock... Thanks a whole bunch
-r

On Thu, 16 Nov 2000, Paul Barton-Davis wrote:

> >how is it done, one gtk_timeout_add() for all _TWTY of them? Sorry man but
> >I am new to the whole concept of gtk... 
> >-r
> 
> ----------------------------------------------------------------------
> gint
> update_level_holds (void *arg)
> 
> {
> 	GList *list = (GList *) arg;
> 	GtkWidget *levelhold;
> 	gint n;
> 	gfloat value;
> 
> 	for (; list; list = g_list_next (list)) {
> 	      levelhold = (GtkWidget *) list->data;
> 
> 	      ... get relevant value for meter ...
> 
>       	      gtk_level_hold_set (levelhold, value);
> 	}
> 	return TRUE;
> }
> 
> Then, somewhere, do this:
> 
>   GList *level_hold_list = 0;
> 
>    ... construct level holds, add them to the list ...
> 
>   gtk_timeout_add (100, update_level_holds, level_hold_list);
> 
> ----------------------------------------------------------------------
> 
> Clear ? This code is not tested, I'm just passing on the rough idea.
> 
> --p
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list
> 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]