Re: background color in gnome-canvas



hi, you can simply change the style of the widget. Do that as following:


GdkColor bgcolor=your_color_here();
GtkStyle * style;
GtkStyle * defstyle;
GtkWidget * widget=your_widget_here();

defstyle=gtk_widget_get_default_style();
style=gtk_style_copy(defstyle);
style->bg[GTK_STATE_NORMAL]=bgcolor;
gtk_widget_set_style(widget, style);

Note do not modify the default style of widget derectly, you should modiy
the copy of it.

Kevin




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