Re: GtkTreeView



Tim Janik <timj gtk org> writes:

> On 14 Aug 2001, Jonathan Blandford wrote:
> 
> > Tim Janik <timj gtk org> writes:
> > 
> > > On 13 Aug 2001, David Bryant wrote:
> > > 
> > > > > Easier:
> > > > > 
> > > > >  gpointer data;
> > > > >  gtk_tree_model_get (model, iter, 2, &data, NULL);
> > > > > 
> > > > > Regards,
> > > > >                                         Owen
> > > > 
> > > > That's neater, but if you don't want it to crash you'll do this:
> > > > gtk_tree_model_get(model, iter, 2, &data, -1);
> > > > 
> > > > It feels very unnatural finish an arg list with -1...But then
> > > > again arg lists feel altogether unnatural to C++ programmers :^)
> > > 
> > > hm, jonathan, was there actually any pressing need to not let
> > > column numbering start out at 1?
> > 
> > Beyond the fact we're writing our code in C and not pascal?
> 
> well, we're using >0 for quite a couple of id types, GQuark,
> source/handler/signal ids, though those are not as index-alike...
> it would just have been nice to preserve the 0-termination for
> varargs, and it would have made tree paths nicer - i guess. ;)

You never actually see the value of a GQuarks.  I agree, it would have
been nice to have 0 termination, but I felt like 1-based indexing would
play with people's heads a bit more than -1 terminating varargs.  The
python binding(*), especially, would be weird if the first column was
tree.columns[1]

Thanks,
-Jonathan

(*) assuming it bound this -- I haven't actually looked. (-:




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]