Re: Re: Do I _need_ a custom CellRenderer?



Am Mittwoch, den 10.06.2009, 11:15 +0000 schrieb ReKlipz gmail com:

> In order to get a better grasp on things, I actually downloaded the
> source of gtkmm, and gtk+. Realized just how much of a wrapper gtkmm
> actually is (ugh... nasty nasty code. I'm sure there's a reason for
> this though. I hope. :P), and then dove into GtkTreeView,
> GtkTreeViewColumn, GtkCellRenderer* classes and the GtkCellLayout and
> other interfaces.

Most of the code is actually generated. I hope you didn't look at the
generated source code. Did you?

> Carefully studying the sources for about an hour, things just clicked
> late last night. ...cell_set_cell_data() and potentially
> the ...set_cell_data_func() callback turned out to not be being called
> as much as I thought they were initially.
> 
> Everything makes perfect sense except for the has_special_cell
> dependency on cell_set_cell_data(), but at this point, it didn't
> really matter anymore and I stopped looking.

I had no idea what you are talking about until I looked at the code
myself.  I didn't find any mention of "has_special_cell", but apparently
a lot of wacky "convenience" API has been added to the TreeView classes
which I wasn't aware of.

My advice is to use the real TreeView API and none of the confusing
magic "helper" functions and methods, because they only make it a lot
harder to understand.  Create view columns, add cell renderers to them,
connect model columns to cell renderer properties and set up cell data
functions as needed.  That's how it works, everything else is just
smokescreen.

--Daniel




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