本文整理汇总了C#中Gtk.GetIterFirst方法的典型用法代码示例。如果您正苦于以下问题:C# Gtk.GetIterFirst方法的具体用法?C# Gtk.GetIterFirst怎么用?C# Gtk.GetIterFirst使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk
的用法示例。
在下文中一共展示了Gtk.GetIterFirst方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GraphFunc
static void GraphFunc (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
{
var renderer = (RevisionGraphCellRenderer)cell;
Gtk.TreeIter node;
model.GetIterFirst (out node);
renderer.FirstNode = node.Equals (iter);
model.IterNthChild (out node, model.IterNChildren () - 1);
renderer.LastNode = node.Equals (iter);
}
示例2: IsPackageInStore
private bool IsPackageInStore (Gtk.ListStore store, string pname, string pversion, int pname_col, int pversion_col)
{
Gtk.TreeIter search_iter;
bool has_elem = store.GetIterFirst (out search_iter);
if (has_elem) {
while (true) {
string name = (string)store.GetValue (search_iter, pname_col);
string version = (string)store.GetValue (search_iter, pversion_col);
if (name == pname && version == pversion)
return true;
if (!store.IterNext (ref search_iter))
break;
}
}
return false;
}
示例3: GetCurrentFilter
static string GetCurrentFilter (Gtk.TreeModel model)
{
TreeIter filterIter;
string filter = string.Empty;
if (model.GetIterFirst (out filterIter))
filter = (string)model.GetValue (filterIter, 1);
return filter;
}
示例4: 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;
}
示例5: getRowNumOfThisID
//finds the row number (starting at 0) of a cell (usually an uniqueID in col 0)
private static int getRowNumOfThisID(Gtk.TreeStore store, int colNum, int searchedID)
{
TreeIter iter;
int count = 0;
bool iterOk = store.GetIterFirst(out iter);
while(iterOk) {
int thisID = Convert.ToInt32((string) store.GetValue (iter, colNum));
if(thisID == searchedID)
return count;
count ++;
iterOk = store.IterNext(ref iter);
}
return -1;
}
示例6: 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);
}
示例7: getTreeViewNeuromuscular
ArrayList getTreeViewNeuromuscular(Gtk.ListStore ls)
{
TreeIter iter = new TreeIter();
ls.GetIterFirst ( out iter ) ;
ArrayList array = new ArrayList();
do {
EncoderNeuromuscularData nm = (EncoderNeuromuscularData) ls.GetValue (iter, 0);
array.Add(nm);
} while (ls.IterNext (ref iter));
return array;
}
示例8: getTreeViewCurves
// ---------helpful methods -----------
ArrayList getTreeViewCurves(Gtk.ListStore ls)
{
TreeIter iter = new TreeIter();
ls.GetIterFirst ( out iter ) ;
ArrayList array = new ArrayList();
do {
EncoderCurve ec = (EncoderCurve) ls.GetValue (iter, 0);
array.Add(ec);
} while (ls.IterNext (ref iter));
return array;
}
示例9: getEntryListForModel
private List<String> getEntryListForModel(Gtk.ListStore model)
{
List<String> outList = new List<string>();
Gtk.TreeIter iter;
model.GetIterFirst(out iter);
if(iter.Equals(null))
return null;
do
{
outList.Add(model.GetValue (iter, 0).ToString());
}while(model.IterNext(ref iter));
return outList;
}
示例10: RebuildAddTaskMenu
private void RebuildAddTaskMenu(Gtk.TreeModel categoriesModel)
{
Gtk.Menu menu = new Menu ();
Gtk.TreeIter iter;
if (categoriesModel.GetIterFirst (out iter)) {
do {
ICategory category =
categoriesModel.GetValue (iter, 0) as ICategory;
if (category is AllCategory)
continue; // Skip this one
CategoryMenuItem item = new CategoryMenuItem (category);
item.Activated += OnNewTaskByCategory;
item.ShowAll ();
menu.Add (item);
} while (categoriesModel.IterNext (ref iter));
}
addTaskButton.Menu = menu;
}