Re: GtkTreeView comments



On Mon, 11 Jun 2001, Brian Cameron wrote:

>
> Gtk Experts:
>
> I am now working on the ATK interfaces for the GtkTreeView widget when
> it is displaying as a GtkListStore.
>
> The interface that I am workin on returns the cell value given the
> row/column table coordinates (of the GtkTreeView, not the coordinates
> of the GtkTreeModel).
>
> I found that there is no easy way to get the GtkTreeModel column number
> given the GtkTreeView column number.  I found that I had to get the
> GtkTreeViewColumn structure and dig through its "attributes" to get
> this information.  It seemed like there should be an access function for
> returning this information.  Or am I wrong here?

There isn't a 1-1 mapping between view columns and model columns.  One
column in the view may depend on many model columns (one giving the text,
one giving the forground colour, one saying whether to use boldface or
not, etc).  You can also use one model column as an attribute of multiple
view columns.

I suppose that the following prototype would do what you want (this hasn't
been implemented yet!):
  gint gtk_tree_view_column_lookup_attribute(GtkTreeViewColumn *column,
                                             const gchar *attribute);

With a function like this you could lookup what model column is used to
calculate the "text" attribute of a column, which seems to be what you
want.  You may need some special cases for other cell renderers though (eg
GtkCellRendererToggle).

James.

-- 
Email: james daa com au
WWW:   http://www.daa.com.au/~james/






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