[gtkada] gtk.text to string

Jeffrey Carter jrcarter at acm.org
Sat Aug 18 02:06:18 CEST 2001


> procedure convertir (b: access gtk.button.gtk_button_record'class) is
>      text: string:="";
>       begin
>          cadena:=gtk.text.get_text(texto);
>          put(text); --I did this only to know if it runs
> end convertir;

Others have suggested that you need to use pointers, but that advice is
usually wrong when using Ada, and this case is no exception:

procedure Convertir (B : access Gtk.Button.Gtk_Button_Record'Class) is
   Text : [constant] String := Gtk.Text.Get_Text (Texto);
begin -- Convertir
   Put_Line (Item => Text);
end Convertir;

Does what you need without any pointers.

-- 
Jeff Carter
"I blow my nose on you."
Monty Python & the Holy Grail




More information about the gtkada mailing list