[gtkada] Patch for String_List in Gtk.enums - Going in

Emmanuel Briot briot at ACT-Europe.FR
Wed Sep 12 10:34:26 CEST 2001


Jeff Creem writes:
 > My item 1 really can not be cleanly implemented from outside the gtk-enums
 > package since only
 > the body of this package knows that the returned address (from Convert) is
 > the address of a Interfaces.C.Strings.chars_ptr. This could be done outside
 > the package with some unchecked
 > conversions but it would be subject to breaking with changes inside of
 > gtk-enums and not
 > really an appropriate use of unchecked_conversion (since it would be an
 > unchecked_conversion
 > from a non-published representation)

Your patch seems indeed interesting. The free routine could be indeed needed in
some cases (I never needed it, but then I might have left some memory leaks
:-()

A small suggestion, though, regarding the location of this routine: do you
think we could make it a fourth generic parameter in Glib.Glist.Generic_List ?
This could then be called automatically from Remove and Remove_Link ?
Maybe it was what you planned, already ?

Go ahead and send us the code, I'll take care of integrating this into GtkAda.

As for the Find routine, I indeed agree with you that it would be better in a
contrib/ package (or maybe an example/ that could be automatically integrated
into the documentation (see the bottom of glib-glist.ads for an example on how
to integrate code into the documentation).


Emmanuel




More information about the gtkada mailing list