[gtkada] trying toset a color

Emmanuel Briot briot at adacore.com
Tue Feb 14 12:46:29 CET 2006


> I try to set the bacground color of a label, and it doesn't work:
>
> c_white, c_black : Gdk_Color;
>     c_white := Gdk.Color.White(Gtk.Widget.Get_Default_Colormap);
>     Modify_Bg(lb, State_Normal , c_white);
>
> the label stays gray. Modify_Fg works fine.
>
> can someone help me ?

A label doesn't have a physical window associated to it, so you can't set its 
color. You have to put the label inside a Gtk_Event_Box, and change the 
background color of the box itself.

Emmanuel



More information about the gtkada mailing list