本文整理汇总了C#中Gtk.ScrollToCell方法的典型用法代码示例。如果您正苦于以下问题:C# Gtk.ScrollToCell方法的具体用法?C# Gtk.ScrollToCell怎么用?C# Gtk.ScrollToCell使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk
的用法示例。
在下文中一共展示了Gtk.ScrollToCell方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ScrollToIter
private void ScrollToIter (Gtk.TreeView tree, Gtk.TreeIter iter)
{
Gtk.TreePath path = tree.Model.GetPath (iter);
if (path != null)
tree.ScrollToCell (path, null, false, 0, 0);
}
示例2: TreeviewScrollToLastRow
public static void TreeviewScrollToLastRow(Gtk.TreeView tv, Gtk.ListStore store, int nrows)
{
TreeIter iter = new TreeIter();
bool iterOk = store.GetIterFirst(out iter);
if(! iterOk)
return;
for(int i=0; i < (nrows -1); i++)
iterOk = tv.Model.IterNext (ref iter);
if(! iterOk)
return;
TreePath path = store.GetPath (iter);
LogB.Debug(path.ToString());
tv.ScrollToCell (path, tv.Columns[0], true, 0, 0);
}
示例3: TreeviewSelectRowWithID
//selects a row that has an uniqueID (usually at col 0)
public static bool TreeviewSelectRowWithID(Gtk.TreeView tv, Gtk.TreeStore store, int colNum, int id, bool scrollToRow)
{
if(id <= 0)
return false;
int rowNum = getRowNumOfThisID(store, colNum, id);
if(rowNum == -1)
return false;
//set the selected
int count = 0;
TreeIter iter;
bool iterOk = store.GetIterFirst(out iter);
while(iterOk) {
if(count == rowNum) {
//1 select row
tv.Selection.SelectIter(iter);
//2 scroll to that row
if(scrollToRow) {
TreePath path = store.GetPath (iter);
LogB.Debug(path.ToString());
tv.ScrollToCell (path, tv.Columns[0], true, 0, 0);
}
return true;
}
count ++;
store.IterNext(ref iter);
}
return false;
}
示例4: TreeviewAddRow
//startOrEnd is true at start, false at end
public static void TreeviewAddRow(Gtk.TreeView tv, TreeStore store, string [] row, bool startOrEnd)
{
TreeIter iter = new TreeIter();
store.GetIterFirst(out iter);
if(startOrEnd)
iter = store.InsertWithValues(0,row);
else
iter = store.AppendValues(row);
//scroll treeview if needed
TreePath path = store.GetPath (iter);
tv.ScrollToCell (path, null, true, 0, 0);
}