Re: Need to get the tree view from the model



Emmanuele Bassi wrote:
On Wed, 2008-09-17 at 13:48 +0000, dhk wrote:
What is the most direct way to get the tree view from the tree model? I don't see a function for doing this.

it wouldn't make any sense.

a model can be used as the data source for many TreeView widgets.

Also, when I went to the source, GtkTreeModel is defined a follows: typedef struct _GtkTreeModel GtkTreeModel; /* Dummy typedef */

Why is it called a "Dummy typedef" and why can't I find the structure for it?

there is no data structure: GtkTreeModel is an interface. the dummy
typedef is there just for type casting purposes.

ciao,
 Emmanuele.

I have different treeviews that use the same model, each on a notebook tabs. Whenever a row is added I call gtk_tree_model_foreach(), which passes in the model, to get the highest line number (user_data is used to pass back the number). My GtkTreeModelForeachFunc function uses a static variable to keep track of the highest number. The problem is if the user switches tabs I need to reset the static variable since the treview changed.

What I think I'll do is after the gtk_tree_model_foreach() call when I get my line number I'll call my GtkTreeModelForeachFunc with NULLs which will reset my static variable. That should be acceptable.

Thanks all,
Dave







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