Re: GtkTreeModelMapping

On 14 Feb 2001, Havoc Pennington wrote:

> Alexander Larsson <alla lysator liu se> writes:
> > I was gonna put some abstract types in a GtkTreeView to view them, only
> > i didn't want to copy strings from it and place in a GtkListStore, so I
> > wrote a TreeModel that takes another model and generates a new one where
> > the columns can be specified as transformations of the data in the
> > original model.
> >
> > For each column in the model a (src_column, col_type, map_func, user_data)
> > tupel is used to map the value, where the map_func is of the type:
> >
> > typedef void (* GValueMapFunc) (const GValue *a,
> > 				GValue *b,
> > 				gpointer user_data);
> >
> >
> > I think this is of general interest. Comments?
> >
> Put it in Bugzilla for 2.0 API freeze,
 Will do. Bug 50947.

> I'd be tempted to say it
> shouldn't go in for 2.0 though. (The tree is still pretty unfinished,
> and adding more stuff to it seems like a bad idea. I'd like to lose
> TreeModelSimple also.)

I belive it will make the tree widget a lot easier to use if you have
abstract datatype that you want to present in a tree. Having this means
you won't have to write custom models all the time, or having to sync your
real model with some copy in a GtkListStore all the time.

Also, the code is really simple, basically three functions + proxies of
all gtktreemodel calls and signals.

/ Alex

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