GtkDrawingArea and colors




What is the cheapest way of changing just one color, say, the
style->bg[n] of a widget?
I looked at earlier mails on the topic and all that I could 
figure out was that one has to grab the style, update the color 
and then attach the new style. There has to be an easier way and
I am somehow missing it.

I have tried the following and not only that it does not work, it
also generates a core dump at program termination.
   gdk_color_parse(color_text, &color);
   gdk_color_alloc(gtk_widget_get_default_colormap(), &color);
   widget->style->bg[0] = color;

The widget that I am using is a GtkDrawingArea and I want to change
its background color to black.

Thanks in advance.
saadat@east.la.asu.edu



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