[Gtk-sharp-list] Changing button color using GTK#
John Bailo
jabailo@earthlink.net
Tue, 07 Sep 2004 16:03:33 -0700
Aleksandar Dezelin wrote:
>1)
>Hi, I'm new to mono and Gtk#. I have to port a System.Windows.Forms app to
>Mono and I have decided to use Gtk#. I need a navy blue button on a form but
>when I triy to set it's color using button.ModifyBg and Gdk.AllocColor,
>button color doesn't change.
>
>Does anybody know how to change a button color?
>
>
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);