[Gtk-sharp-list] (no subject)

Gonzalo Paniagua Javier gonzalo@ximian.com
23 Apr 2003 22:59:18 +0200


El mié, 23 de 04 de 2003 a las 22:55, Simon Guindon escribió:
> How does one iterate the nodes in a TreeView in GTK#?  I want to be able
> to loop through them, find the row I'm looking for via reading the value
> of the column in that row.
> 
> I know how to read a column from a row:
> 
> tvFriendsList.Selection.GetSelected(out model, ref iter);
> model.GetValue(iter, (int)ColumnId.JID, out val);
> 
> But not example sure how to loop through them all.

I do this in nunit-gtk:

	void GrayOut (TreeIter iter)
	{
		SetValue (iter, 0, grayCircle);
		TreeIter child;
		if (!IterChildren (out child, iter))
			return;
		do {
			GrayOut (child);
		} while (IterNext (out child));
	}

If the 'iter' parameter is the first node, this method traverses all of
its childrens.

-Gonzalo