public static void Populate(this ComboBox comboBox, EntryList entryList) { comboBox.Clear(); ListStore listStore = new Gtk.ListStore( (entryList[0].Value.GetType()), (entryList[0].Name.GetType()) ); comboBox.Model = listStore; CellRendererText text = new CellRendererText(); comboBox.PackStart(text, false); comboBox.AddAttribute(text, "text", 1); foreach (Entry entry in entryList) { listStore.AppendValues(entry.Value, entry.Name); } TreeIter iter; if (listStore.GetIterFirst(out iter)) { comboBox.SetActiveIter(iter); } }
public static void Populate(this ComboBox comboBox, EntryList entryList) { comboBox.Clear(); ListStore listStore = new Gtk.ListStore( (entryList[0].Value.GetType()), (entryList[0].Name.GetType()) ); comboBox.Model = listStore; CellRendererText text = new CellRendererText(); comboBox.PackStart(text, false); comboBox.AddAttribute(text, "text", 1); foreach (Entry entry in entryList){ listStore.AppendValues(entry.Value,entry.Name); } TreeIter iter; if (listStore.GetIterFirst (out iter)) { comboBox.SetActiveIter (iter); } }