Re: Widget updates




Hi!

I think you should use timeouts better than sleeps in your code, because timers doesn't load the CPU. See gtk_timeout_add and gtk_timeout_remove (in gtk+-1.2) in the GTK reference manual.

For example, if you want to update something every second, you should do something like this


void function (gpointer data)
{
  update (data);
}

guint timer;

timer = gtk_timeout_add (1000 /* time in miliseconds */, function, data);




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