Re: ListStore and cell rendering



On Friday 05 March 2004 23:01, Ron Lockwood-Childs wrote:

gtk_tree_view_column_pack_start/end() is just what I was referring to

when I wrote:
I've read that it's possible to pack multiple renderers into a
column, but it seems to me that requires knowledge of how many
widgets the column will hold, ahead of time.

Is this the case?  The point is, I don't know how many items each cell
in a column could/will hold.  I want to string any number of labels
together in a cell based on the contents of a text string (how else can
I have different tooltips based on where in the cell the mouse is
hovering, as requested by the end user ?).

As far as I know GtkTreeView currently doesn't support tooltips anyway (the 
feature is planned for Gtk-2.6).

I don't think you can add/remove individual cell renderers from a tree view 
column as you please.

But you should be able to either use gtk_tree_view_column_clear() to get rid 
of all cell renderers [I am not entirely sure that's what this function does] 
and then re-fill the column, or just remove the entire tree view column from 
the tree view, and make a new column with the cell renderers you want and 
insert that into the old position.


What I'm not comprehending from the documentation is:
A) gtk_tree_view_column_pack_start/end(): this affects an entire column
at once, does it not?  If not, how do these routines "know" which row
within a particular column to pack the cell renderers into?

A 'cell renderer' renders an entire 'column within a column', for each row.


B) I told the ListStore model ahead of time what to expect in each
column (COLUMN_STRING, COLUMN_STRING... etc) and then used
gtk_tree_view_append_column() to add the appropriate columns to the
TreeView object.  I successfully appended columns with single cell
renderers to the TreeView.. but these seem to be static, pre-defined
properties.  Can I really pack a different set of column renderers for
different rows, as each new row is appended onto the list?

No, you can't, because cell renderers are responsible for rendering all rows 
within the column they've been packed into.

Why don't you just concatenate the strings you have to a single string?

Cheers
-Tim

PS: http://scentric.net/tutorial/treeview-tutorial.html





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