[Gtk-sharp-list] List Store API suggestion

John BouAntoun jba-mono@optusnet.com.au
Mon, 23 Feb 2004 19:34:06 +1100


Mike, 

My answers in line.
On Sun, 2004-02-22 at 12:02, Mike Kestner wrote:
> On Fri, 2004-02-20 at 23:06, John BouAntoun wrote:
> 
> > - Change IterNChildren() be something like GetRowCount()
> > - Have IterNChildren(TreeIter iter) call GetRowCount if iter == null
> 
> Make it a RowCount prop instead and I'm on board. 

I'm a huge fan of using properties and here seem to be lots of places
where parameterless functions should be properties that I can see. I
just thought that you had been in the habit of using functions in the
past and wanted to keep a consistency. 
> 
> 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? 

Coming from a gtk+ background you would most likely be looking to do
what the docs and tutorials say (supply a null value). So the question
is, which is a better replacement for a null treeiter, a function with
no parameters or one with TreeIter.Zero. On that instance I would say
stick with what we have now (an override that doesn't accept a TreeIter)
and do the same thing with it (call the RowCount Property).

JBA