[gtkada] Setting a label's text color

Marc A. Criley marccriley at earthlink.net
Tue Dec 25 03:45:08 CET 2001


Preben Randhol wrote:
> 
> "Marc A. Criley" <marccriley at earthlink.net> wrote on 23/12/2001 (14:44) :
>
> >    procedure Set_Logging_Status (Active : in Boolean)
> >    is
> >       Fg_Color  : Color.Gdk_Color;
> >       Bkg_Color : Color.Gdk_Color;
> >       CM        : Color.Gdk_Colormap;
> >
> >       Label_Style : Style.Gtk_Style;
> >
> >    begin
> >       Fg_Color := Color.Parse("White");
> >       Bkg_Color := Color.Parse("Red");
> >
> >       CM := Widget.Get_Default_Colormap;
> >
> >       Color.Alloc(CM, Fg_Color);
> >       Color.Alloc(CM, Bkg_Color);
> >
> >       Label_Style :=
> >            Style.Copy(Event_Box.Get_Style(Data.Enabled_Eventbox));
> >
> >       Style.Set_Foreground(Label_Style, Enums.State_Normal, Fg_Color);
> >       Style.Set_Background(Label_Style, Enums.State_Normal, Bkg_Color);
> >
> >       Event_Box.Set_Style(Data.Enabled_Eventbox, Label_Style);
> 
> -- Add this line:
> 
>         Label.Set_Style(Data.Your-Label-Object-here, Label_Style);
> 
> >    end Set_Logging_Status;

I added the specific line:
          Label.Set_Style(Data.Enabled_Label, Label_Style);

But when running my application I get an error:
     Gdk-ERROR **: BadImplementation (server does not implement operation)
  serial 31 error_code 17 request_code 20 minor_code 0

I'm using GtkAda 1.2.12 with GNAT 3.13p.

Marc




More information about the gtkada mailing list