Re: CellRenderText properties question.
- From: Owen Taylor <otaylor redhat com>
- To: Sven Neumann <sven gimp org>
- Cc: "Carl B. Constantine" <duckwing duckwing ca>, gtk-list gnome org
- Subject: Re: CellRenderText properties question.
- Date: 04 Mar 2003 22:06:01 -0500
On Tue, 2003-03-04 at 17:51, Sven Neumann wrote:
> > How can I change attributes on a single cell without having extra
> > data in my model or do I really need the extra data in my model? I'm
> > sure I'm missing something obvious but the docs are confusing. Also,
> > storing extra attribute data in my ListStore adds memory overhead.
>
> of course you need the extra data. You want to display additional
> information, where should it come from if not from the model? Of
> course you can write your own custom cell renderer which calculcates
> the information for each cell but unless you want to do that, you need
> an extra column in your model. Please note that the model columns
> don't necessarily correspond to the view columns. It thus doesn't make
> any sense to speak of an "invisible" column in a model.
It should be pointed out here that if you _do_ want to calculate
things per-cell, then there's a much easier way to do it than
to write your own renderer - use:
http://developer.gnome.org/doc/API/2.2/gtk/GtkTreeViewColumn.html#gtk-tree-view-column-set-cell-data-func
This is gives you a callback to calculate the properties, usually
from an application-specific data structure you store in a
treeviewcolumn (you can use G_TYPE_POINTER or register your own
type with g_boxed_type_register_static())
Regards,
Owen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]