Re: Associating data with a "tree-item" in TreeModel/View in GTK+2



"Janus N." Tøndering <j nus person dk> writes:

I have a list of data in a TreeView. What I want is a way to associate
some data (in this case an URL) to each element in the list so that this
data can be uniquely retrieved when you have a path or iter to the item.

I have searched the API references ... but I cannot seem to find a
proper solution.

Any ideas would be greatly appreciated!

You can just stick the data in the GtkTreeModel, just like the data
you're displaying - it's fine to have data in the model that never
gets displayed. Just add an extra column to the model. Then you
retrieve the data in the column with gtk_tree_model_get().

Havoc



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