/// <summary>Checks whether two path are equal. They are considered equal if they have the same indice.</summary> public static bool PathsAreEqual (TreePath path1, TreePath path2) { return (path1.Compare(path2) == 0); }
void select_index(int idx) { TreePath path = new TreePath (new int[] { idx }); TreePath first, last; bool use_align; float row_align, col_align; tree_view.Selection.SelectPath (path); if (tree_view.GetVisibleRange (out first, out last) && (path.Compare (first) == -1 || path.Compare (last) == 1)) { use_align = true; row_align = 0.5f; col_align = 0.0f; } else { use_align = false; row_align = 0.0f; col_align = 0.0f; } tree_view.ScrollToCell (path, null, use_align, row_align, col_align); }