RE: GtkTreeView and GtkTreeViewColumn question



> -----Original Message-----
> From: iluvlinux
> Sent: Tuesday, May 20, 2008 10:12 PM
> 
> I have a treeview widget and by using an api gtk_tree_view_get_path_at_pos
> i can get the GtkTreepath and GtkTreeViewColumn Objects.
> So my question is is it possible to get the column number from the
> GtkTreeViewColumn. If not can some one suggest a solution for that.

I do something similar where I need to get a list index (effectively the
column number) from the column. I do it by "tagging" the column with the
value like this:

  for (i = 0; i < cols; i++)
  {
    column = gtk_tree_view_get_column(GTK_TREE_VIEW(treeView), i);
    OBJECT_SET_DATA(column, "list-index", (gpointer)i);
  }

Then to later get back the value from the GtkTreeViewColumn:

  listIndex = (int)OBJECT_GET_DATA(column, "list-index");

Ian




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