Miscellany
public text v1 · immutableprivate static int GetSelectedIndex(TreeView tv) {
TreePath[] rows = tv.Selection.GetSelectedRows();
if (rows.Length == 0)
return -1;
return rows[0].Indices[0];
}