Re: change window color

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

 



GTK+ contains these following functions for setting widget colors:
 void        gtk_widget_modify_fg            (GtkWidget *widget,
                                             GtkStateType state,
                                             const GdkColor *color);
 void        gtk_widget_modify_bg            (GtkWidget *widget,
                                             GtkStateType state,
                                             const GdkColor *color);
 void        gtk_widget_modify_text          (GtkWidget *widget,
                                             GtkStateType state,
                                             const GdkColor *color);
 void        gtk_widget_modify_base          (GtkWidget *widget,
                                             GtkStateType state,
                                             const GdkColor *color);

You'll want to do something along these lines:
	const GdkColor red = { 0, 65535, 0, 0 };
	gtk_widget_modify_bg( widget, GTK_STATE_NORMAL, &red );

Maybe even using the following to be on the safe side:
	gtk_widget_modify_bg( widget, GTK_STATE_ACTIVE, &red );
	gtk_widget_modify_bg( widget, GTK_STATE_PRELIGHT, &red );
	gtk_widget_modify_bg( widget, GTK_STATE_SELECTED, &red );
	gtk_widget_modify_bg( widget, GTK_STATE_INSENSITIVE, &red );

You should be careful though, as children typically have their
backgrounds defined too and they won't inherit, especially with things
like buttons which have prelight colors defined.

Anyway, might I inquire why you're defining a widget's color?

-Brian

_______________________________________________

gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux