Re: CellRenderText properties question.



* Sven Neumann (sven gimp org) wrote:
> the API reference is not exactly the place where you'd look for code
> examples. The gtk-demo as found in the demos directory of the GTK+
> source tree seems like a good place to look for such examples.

I didn't look there, I looked at the various examples that come with
GTK.

> 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.

Yes, I suppose that's correct. I'm a bit confused as you create the
column with gtk_tree_view_column_new (or
gtk_tree_view_column_new_with_attributes) and then call
gtk_tree_view_append_column to append it to the tree view, at least for
the view. However, I gather I would call gtk_list_store_new with the
extra column (or columns) so I have a place in the store to save my
data, but the view doesn't show it.

This makes sense now that you point that out. I was doing a 1:1 mapping
between the TreeModel (ListStore in my case) and the TreeView but it
doesn't have to be such.

Thanks for the help!

-- 
 .''`.      Carl B. Constantine
: :' :     duckwing duckwing ca
`. `'    GnuPG: 135F FC30 7A02 B0EB 61DB  34E3 3AF1 DC6C 9F7A 3FF8
  `-  Debian GNU/Linux -- The power of freedom

Attachment: pgpj5XGpjxgoY.pgp
Description: PGP signature



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