本文整理汇总了C#中Gtk.ListStore.GetIterFromString方法的典型用法代码示例。如果您正苦于以下问题:C# ListStore.GetIterFromString方法的具体用法?C# ListStore.GetIterFromString怎么用?C# ListStore.GetIterFromString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.ListStore
的用法示例。
在下文中一共展示了ListStore.GetIterFromString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SaveList
public static void SaveList(ListStore list, string path)
{
path = path + "streams.list";
File.Delete(path);
for (int i = 0; i < list.IterNChildren(); i++) {
TreeIter iter;
list.GetIterFromString (out iter, i.ToString ());
File.AppendAllText(path, list.GetValue(iter, 0).ToString());
File.AppendAllText(path, " ");
File.AppendAllText(path, list.GetValue(iter, 1).ToString());
File.AppendAllText(path, "\n");
}
}
示例2: MainWindow
public MainWindow()
{
XML gxml = new XML(null, "MultiMC.GTKGUI.MainWindow.glade",
"mainVBox", null);
gxml.Toplevel = this;
gxml.Autoconnect(this);
XML gxml2 = new XML(null, "MultiMC.GTKGUI.InstContextMenu.glade",
"instContextMenu", null);
gxml2.Autoconnect(this);
/*
* HACK: the nested menu isn't picked up by the first gxml object. It is probably a GTK# bug.
* This is the fix - manually asking for the menu and connecting it.
*/
XML gxml3 = new XML(null, "MultiMC.GTKGUI.MainWindow.glade",
"menunew", null);
gxml3.Autoconnect(this);
newInstButton.Menu = menunew;
this.Add(mainVBox);
ShowAll();
this.WidthRequest = 620;
this.HeightRequest = 380;
DeleteEvent += (o, args) => Application.Quit();
// Set up the instance icon view
instListStore = new ListStore(
typeof(string), typeof(Gdk.Pixbuf), typeof(Instance));
instView.Model = instListStore;
instView.TextColumn = 0;
instView.PixbufColumn = 1;
instView.ItemWidth = -1;
Gtk.CellRendererText crt = instView.Cells[0] as CellRendererText;
crt.Editable = true;
crt.Edited += (object o, EditedArgs args) =>
{
int EditedIndex = int.Parse(args.Path);
TreeIter iter;
// don't allow bad names
if(!Instance.NameIsValid(args.NewText))
return;
System.Console.WriteLine("Path: " + args.Path + " New text: " + args.NewText);
if(instListStore.GetIterFromString(out iter,args.Path))
{
instListStore.SetValue(iter, 0, args.NewText);
Instance inst = instListStore.GetValue(iter, 2) as Instance;
inst.Name = args.NewText;
}
};
instView.Orientation = Orientation.Vertical;
instView.ButtonPressEvent += (o, args) =>
{
if (args.Event.Button == 3 &&
instView.GetPathAtPos((int)args.Event.X,
(int)args.Event.Y) != null)
{
instView.SelectPath(instView.GetPathAtPos(
(int)args.Event.X, (int)args.Event.Y));
instContextMenu.Popup();
}
};
instView.KeyPressEvent += (object o, KeyPressEventArgs args) =>
{
if(args.Event.Key == Gdk.Key.F2)
{
if(instView.SelectedItems.Count() != 0)
instView.SetCursor(instView.SelectedItems[0], instView.Cells[0], true);
}
else if(args.Event.Key == Gdk.Key.Escape)
{
if(EscPressed != null)
EscPressed(this, EventArgs.Empty);
}
};
// Set up the task list
EventfulList<Task> tList = new EventfulList<Task>();
tList.Added += TaskAdded;
tList.Removed += TaskRemoved;
TaskList = tList;
taskProgBars = new Dictionary<int, Box>();
// Set up the instance list
EventfulList<Instance> iList = new EventfulList<Instance>();
iList.Added += InstAdded;
iList.Removed += InstRemoved;
InstanceList = iList;
helpButton.Sensitive = false;
if(OSUtils.OS == OSEnum.Linux)
//.........这里部分代码省略.........