Re: GtkLabel Text Color



Hi Luiz,
it's not always obvious which color changing method is appropriate to get
the desired effect on a given type of widget. My experience is that you
learn best what effect a gtk_widget_modify* function has when you
systematically experiment with them. For example the gtk_widget_modify_bg
does not always change the background color of a widget. Some widgets
don't have their own window and for those widgets the background will be
determined by the background of the parent widget.
For your problem gtk_widget_modify_fg should do the trick.

See also
http://developer.gnome.org/doc/API/2.0/gtk/gtk-question-index.html#id2904195

Regards...Peter

> Date: Wed, 27 Aug 2003 00:09:50 -0300
> Subject: GtkLabel Text Color
> From: "Luiz Rafael Culik Guimaes" <culikr uol com br>
> Cc: gtk-list gnome org
>
> Hi friends
>
> How to change the color of an text of
> an GTK_LABEL widget
>
> i've tryed the bellow with out sucess
>
>
>         GdkColor color;
>         gdk_color_parse ("#FF3341",
> &color);
>         GtkWidget *label;
>         label =3D gtk_label_new("Test");
>         gtk_widget_show( label );
>
>         gtk_widget_modify_text (label,
> GTK_STATE_NORMAL, &color);
>
> Regards
> Luiz
-- 
====================================================================
Peter Krüger

applied software solutions (appss) GmbH
Sandtorstr. 23
D-39106 Magdeburg
Germany

Phone:  +49-(0)391-54486-19388
Fax:    +49-(0)391-54486-19222
email:  krueger appss de
URL:    http://www.appss.de

Managing Director: Uwe Hess, Dietmar Schäfer
Register: HRB12386, AG Mageburg

"Virtual business becomes reality!"

This e-mail may contain confidential and/or privileged information. If
you are not the intended recipient (or have received this e-mail in
error) please notify the sender immediately and destroy this e-mail. Any
unauthorised copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.
====================================================================




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