[Gtk-sharp-list] Change background color

Miguel de Icaza miguel@ximian.com
11 Mar 2003 23:33:11 -0500


Hello,

> How can I change the background color of a widget
> 
> could be like this?
> 
> VBox fieldsbox = new VBox (true, 10);
> Gdk.Color color = new Gdk.Color();
> fieldsbox.ModifyBg(StateType.Normal, color);
> 
> if so, how can I change to white the background color of the vbox?

You can only change the background of "window" widgets.  Vbox is a
window-less widget.  To achieve that, put your VBox inside an EventBox
widget for example (that widget will just provide you with a window).

Also, colors need to be allocated, see the nice docs I wrote about that
on CVS monodoc.

Miguel