[Gtk-sharp-list] color in widgets

Miguel de Icaza miguel@ximian.com
23 Sep 2003 22:08:00 -0400


> I have a small question about using color with widgets. When I use the
> following code, I get a button with a red background. But when Button is
> replaced by Label or Entry in this code, their background color is not
> changed:
> =====
> Button e = new Button("I am a red button");
> Gdk.Color c = new Gdk.Color();
> Gdk.Color.Parse("red", ref c);
> e.ModifyFg(StateType.Normal, c);
> ========
> Am I missing something here? (I compiled the latest Gtk version out of
> CVS last friday, after the 0.11 release. Mono version= 0.26)

The color is not allocated.  See the documnetation for T:Gdk.Colormap in
Monodoc for examples.