Re: change bg color of gtk_label



I didn't find out how to change the background color
of a GtkLabel.

You can't, because a label has no X window. You must change 
the color of the label's parent instead. This is an example
with a button:
Carlos

--------------------------------
GdkColor color;

color.red = 0;
color.green = 65000;
color.blue = 0;

style = gtk_style_copy (gtk_widget_get_style (button));
style->bg[GTK_STATE_NORMAL] = color;
style->bg[GTK_STATE_ACTIVE] = color;
style->bg[GTK_STATE_PRELIGHT] = color;
style->bg[GTK_STATE_SELECTED] = color;
style->bg[GTK_STATE_INSENSITIVE] = color;
gtk_widget_set_style (button, style);
--------------------------------




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