[Gtk-sharp-list] List Store API suggestion

Mike Kestner mkestner@ximian.com
Mon, 23 Feb 2004 12:39:29 -0600


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 pass
> > 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 a
> 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 want
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 need
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.

So I'll accept a patch that provides:

IterNChildren () { IterNChildren (TreeIter.Zero); }
IterNChildren (TreeIter)  <- with Zero handling

on the TreeModel interface and all implementors, and an additional
RowCount prop on the ListStore which uses the void overload.

-- 
Mike Kestner <mkestner@ximian.com>