本文整理汇总了C#中Gtk.TreeStore.GetIterFirst方法的典型用法代码示例。如果您正苦于以下问题:C# TreeStore.GetIterFirst方法的具体用法?C# TreeStore.GetIterFirst怎么用?C# TreeStore.GetIterFirst使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.TreeStore
的用法示例。
在下文中一共展示了TreeStore.GetIterFirst方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ObjectWindow
public ObjectWindow(RuntimeThread runtimeThread, object root)
: base(GetTitle(root))
{
SetDefaultSize(250, 300);
SkipPagerHint = true;
SkipTaskbarHint = true;
scroller = new ScrolledWindow();
scroller.BorderWidth = 5;
scroller.ShadowType = ShadowType.In;
Add(scroller);
store = new TreeStore(typeof(string), typeof(object), typeof(bool));
//TreeModelSort storeSort = new TreeModelSort(store);
//storeSort.SetSortColumnId(0, SortType.Ascending);
view = new TreeView(store);
view.AppendColumn(null, new CellRendererText(), "text", VALUE_TEXT);
view.HeadersVisible = false;
view.RowExpanded += OnTreeRowExpanded;
view.RowCollapsed += OnTreeRowCollapsed;
scroller.Add(view);
Add(false, new TreeIter(), "", root, false, false);
TreeIter first;
store.GetIterFirst(out first);
view.ExpandRow(store.GetPath(first), false);
}
示例2: ContentDirectoryInfo
public ContentDirectoryInfo (RemoteContentDirectory contentDirectory)
{
if (contentDirectory == null) {
throw new ArgumentNullException ("contentDirectory");
}
this.content_directry = contentDirectory;
this.store = new TreeStore (typeof (ObjectRow));
var objects = new TreeView ();
var column = new TreeViewColumn ();
var cell = new CellRendererText ();
column.PackStart (cell, true);
column.SetCellDataFunc (cell, RenderObject);
column.Title = "Objects";
objects.AppendColumn (column);
objects.Selection.Changed += HandleObjectsSelectionChanged;
objects.RowExpanded += HandleObjectsRowExpanded;
objects.Model = store;
var root = contentDirectory.GetRootObject ();
store.AppendValues (new ObjectRow (root));
TreeIter iter;
store.GetIterFirst (out iter);
store.AppendValues (iter, loading);
Add (objects);
}
示例3: putRowNumbers
private void putRowNumbers(TreeStore myStore)
{
TreeIter myIter;
bool iterOk = myStore.GetIterFirst (out myIter);
if(iterOk) {
int count = 1;
do {
store.SetValue(myIter, 0, (count++).ToString());
} while (myStore.IterNext (ref myIter));
}
}
示例4: GenerateTree
private void GenerateTree()
{
store = new TreeStore(typeof(SettingPanel), typeof(string), typeof(string), typeof(bool), typeof(bool), typeof(int));
tvCategory.Model = store;
tvCategory.HeadersVisible = false;
TreeViewColumn col = new TreeViewColumn();
CellRendererPixbuf crp = new CellRendererPixbuf();
crp.StockSize = (uint)IconSize.LargeToolbar;
col.PackStart(crp, false);
col.AddAttribute(crp, "stock-id", 1);
col.AddAttribute(crp, "visible", 3);
col.AddAttribute(crp, "sensitive", 4);
CellRendererText crt = new CellRendererText();
col.PackStart(crt, true);
col.AddAttribute(crt, "markup", 2);
col.AddAttribute(crt, "sensitive", 4);
tvCategory.AppendColumn(col);
tvCategory.Selection.Changed += OnSelectionChanged;
FillTree();
TreeIter it;
if (store.GetIterFirst(out it))
tvCategory.Selection.SelectIter(it);
}
示例5: 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);
}
示例6: prepareSelected
void prepareSelected(TreeView myTreeview, TreeStore myStore)
{
TreeIter myIter = new TreeIter ();
bool iterOk = true;
arrayOfSelectedSessions = new ArrayList (2);
for (int count=0 ; iterOk; count ++) {
if (count == 0) {
iterOk = myStore.GetIterFirst (out myIter);
}
else {
iterOk = myStore.IterNext (ref myIter);
}
if (iterOk) {
arrayOfSelectedSessions.Add (
(string) myTreeview.Model.GetValue (myIter, 0) + ":" + //id
(string) myTreeview.Model.GetValue (myIter, 1) + ":" + //name
(string) myTreeview.Model.GetValue (myIter, 3) //date (forget place)
);
LogB.Information(arrayOfSelectedSessions[count].ToString());
}
}
}
示例7: findRowForIter
void findRowForIter(TreeView myTreeview, TreeStore myStore, out TreeIter myIter, int searchedPosition)
{
int position;
bool firstLap = true;
myStore.GetIterFirst (out myIter);
position = Convert.ToInt32( (string) myTreeview.Model.GetValue (myIter, 0) );
do {
if ( ! firstLap) {
myStore.IterNext (ref myIter);
}
position = Convert.ToInt32( (string) myTreeview.Model.GetValue (myIter, 0) );
firstLap = false;
} while (position < searchedPosition );
}