[Gtk-sharp-list] List Store API suggestion

Steinar Herland steinar.herland@gecko.no
Tue, 24 Feb 2004 07:04:37 +0100

-----Original Message-----
From: gtk-sharp-list-admin@lists.ximian.com
[mailto:gtk-sharp-list-admin@lists.ximian.com] On Behalf Of Mike Kestner
Sent: 23. februar 2004 19:39
To: jba-mono@optusnet.com.au
Cc: gtk-sharp-list@lists.ximian.com
Subject: Re: [Gtk-sharp-list] List Store API suggestion

On Mon, 2004-02-23 at 02:34, John BouAntoun wrote:

> > > The tricky part is that since TreeIter is a value type, you can't
> > > null for it.  Perhaps passing TreeIter.Zero is a reasonable
> > > alternative?
> > Good point, since I suggested we override the IterNChildren(TreeIter
> > iter) for the null case to accomodate gtk+ focused developers, using
> > TreeIter.Zero value going to be intuitive for them?
> Exactly.  That's what docs are for.  :)  The (void) overload is a good
> transform for "1 parameter method with null_ok" AFAICT.  But C
> developers that are familiar with the native API are still going to
> to pass a "NULL" value to that method.  Especially if they are porting
> existing code or using existing C code as a sample.  So I think we
> to handle TreeIter.Zero (I probably should make all those structs
> generate a static Null instead of Zero field) gracefully and explain
> that usage in the docs.

I would say that implementing the INullable interface on the struct is
the correct thing to do here. (Maybe that's what you mean Mike?) All the
System.Data.SqlTypes.SqlXx value-types does it that way.=20

(Note: Don't shoot me if the TreeIter already implements INullable. I
don't have the documentation available right now.)