Hello. > Is there a function to give the number of rows in a treeview?
You probably want to know how many lines are in the GtkTreeModel that serves as data source for GtkTreeView. There is no simple function that would serve you this number, so you'll have to take one of the two available paths: 1) maintain number of rows externally by increasing/decreasing it on additions/removals 2) traverse the whole model and count the lines If you go with second option, gtk_tree_model_foreach function may be of help. Sample counter would look like this: ---- CODE ---- ... gint no_rows = 0; gtk_tree_model_foreach( model, (GtkTreeModelForeachFunc)count, &no_rows ); ... static gboolean count( GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gint *no_rows ) { *no_rows+; return( FALSE ); } ---- CODE ---- Tadej -- Tadej Borovšak tadeboro.blogspot.com tadeb...@gmail.com tadej.borov...@gmail.com _______________________________________________ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list