[gtkada] gtk.text to string

Pedro Díaz Jiménez pdiaz88 at terra.es
Sat Aug 18 05:45:09 CEST 2001


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Saturday 18 August 2001 00:06, you wrote:
> > 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;
>

I like it much better than the other solutions, including mine. Clean & 
elegant

> Does what you need without any pointers.

True, but doing it (right) with pointers doesn't mean its wrong

cheers
Pedro
- -- 

/*
 * Pedro Diaz Jimenez: pdiaz88 at terra.es, pdiaz at acm.asoc.fi.upm.es 
 *                                                  
 * GPG KeyID: E118C651                              
 * Fingerprint: 1FD9 163B 649C DDDC 422D  5E82 9EEE 777D E118 C65
 *                                                  
 * http://planetcluster.org                         
 * Clustering & H.P.C. news and documentation       
 *
 * "La sabiduria me persigue, pero yo soy mas rapido"
 */

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7feTFnu53feEYxlERAuLqAJ47pBLfufSMnl+zwlVYCEx8RMEngACgzOd0
VBkjnaKn17ncFyfO4bZb0+s=
=pG0n
-----END PGP SIGNATURE-----




More information about the gtkada mailing list