本文整理汇总了C#中Gtk.TreePath.Compare方法的典型用法代码示例。如果您正苦于以下问题:C# TreePath.Compare方法的具体用法?C# TreePath.Compare怎么用?C# TreePath.Compare使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.TreePath
的用法示例。
在下文中一共展示了TreePath.Compare方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PathsAreEqual
/// <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);
}
示例2: select_index
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);
}