How to retrieve the identifier of a Label?

97 Views Asked by At

i'm trying to progress in GtkAda using Glade 3.40 which seems cool. I much like thie idea to let the engine of Gtk works for the coder, thru GkAda, & let the coder to concentrate on real added value. -So i tried some examples on internet. The following one compiles & is partially OK. We may see the window with the title, but there is no print of the text in the window. Probably because "lbl" doesn't content the good value to address the window. -But i don't know how to initialize it. I made many trials without success.. Is anyone could help, please? Thanks Mark

With Gtk.Main;      Use Gtk.Main;
With Gtk.Window;    Use Gtk.Window;
With Gtk.Label;     Use Gtk.Label;
With Glib.Convert;  Use Glib.Convert;
With Gtk.Enums;     Use Gtk.Enums;

    Procedure Texte is
       Win     : Gtk_Window;
       Lbl     : Gtk_Label ;
       newline : constant character := character'val(10) ;
       Txt : CONSTANT String := Locale_To_Utf8
                     ("Ça c'est une chaîne de" & Newline &
                      "caractères encodée en UTF-8" & Newline & 
                      "grâce à Locale_To_UTF8") ; 
    begin
       Init ;
       Gtk_New (Win) ;
       Win.Set_Default_Size (100,100) ;
       win.set_title ("Du texte !") ;
    
       Gtk_New (Lbl,txt);
       Lbl.Set_Justify (Justify_center);
       win.add (lbl);     -- No layout
       Win.show_all ;
       Main ;

    end Texte ;
0

There are 0 best solutions below