Hi everybody!
I need help about redrawing two widgets -- a DrawingArea and a HScale. I've got a timer in a parallel thread that increments the scroll value every 300 milliseconds. I also have a callback function that draw a different "plot" in the drawarea whenever the scale value changes.
Now the problem: after changing the value with gtk_range_set_value I queue the redraw of the two widgets with gtk_widget_queue_draw, than I call the gdk_window_process_updates on the main window to effectively redraw everything. Things goes fine until I get the error "<unknown>: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0.", and the program exits. I really don't know what's the matter. Here's the interested part of the code:
Code:
void scroll_timer(union sigval unused)
{
int v, limit;
v=gtk_range_get_value(GTK_RANGE(scale));
limit=gtk_adjustment_get_upper(gtk_range_get_adjustment(GTK_RANGE(scale)));
if(v==limit)
v=0;
else
v++;
gtk_range_set_value(GTK_RANGE(scale),v);
gtk_widget_queue_draw(scale);
gtk_widget_queue_draw(drawarea);
gdk_window_process_updates(gtk_widget_get_window(mainwindow),TRUE);
}