[Gtk-sharp-list] LibGlade
Ricardo Fernández Pascual
rfp1@ono.com
16 Aug 2002 17:36:56 +0200
El vie, 16-08-2002 a las 17:11, Paolo Molaro escribió:
> I reply to this mail just because it brings up one issue I'm worried
> about in the Gtk# API.
> I think GList and GSList should not be exposed in the public Gtk# API.
> They are ugly as hell and should be only used to interface to the
> library: the types exposed should be plain arrays or ArrayLists.
> The same goes for other internal details of the Gtk+ C API, like, the
> use of IntPtr.Zero should be never required to write a Gtk# program, it
> just doesn't belong to a C# interface. Also, eliminating it will give
> us some chance of using Gtk# in untrusted code.
I think that the exposed API should return only IList and ask only for
the IList interface.
If the objects returned by Gtk# implement that interface using an
internal GList class, well that's an implementation detail.
When passing a GList to gtk, gtk# can check if it is a GList and
construct a GList is it isn't. (it can avoid the test too, it's only an
optimization)
I agree that the GList and GSlist types should not be exposed in the
api. They are too low level for C#.
--
Ricardo Fernández Pascual
ric@users.sourceforge.net
Murcia. España.