Reputation: 101
Could anyone provide a TreeModel.Foreach function example?. I am having difficulty figuring out the syntax in c#.
Given an object I would like to search the tree to see if any of the TreeIters contain that object (I know which column to use). The object may be one of three different types.
Upvotes: 2
Views: 658
Reputation: 1886
I know this question has been asked a while ago but since I was looking for a solution to this very question I figured other people might as well.
So here's the correct syntax for the ListStore.Foreach
(I assume the syntax will be the same for TreeModel.Foreach
):
listStore.Foreach(new TreeModelForeachFunc(delegate(TreeModel model, TreePath path, TreeIter iter) {
// Do whatever you want to do here...
}));
I hope this helps somebody.
Upvotes: 3