Gtk.NodeSelection

Since Mono entered the 1.0 beta cycle in early June, I haven’t really been writing code. Throughout the whole summer, I spent most of my time thinking about doing releases and packaging for Mono instead.

Since Mike was here last week, I figured I ought to work on improving the NodeStore stuff. I started thinking about it Thurdsay afternoon, and after a few false starts (and some embarrasing bugs), I got it working on Friday night after dinner.

Here’s the patch.

Mike is in the middle of preparing the Gtk# tree to move to the latest version of Gtk, but this should get merged when he’s done with that.

With this patch, you can now do something like this:

void OnButtonClicked (object o, EventArgs a)
{
	NodeSelection selection = view.Selection;
	foreach (ITreeNode node in selection.SelectedNodes)
	Console.WriteLine (node.ID);
}

The selection methods in NodeSelection all support ITreeNode, that means you can kiss Gtk.TreeIter goodbye!

Leave a comment