Thanks Vlad, I've got it working now.

Is there a way of combining multiple columns on a ComboBox? I can do it
with a TreeView without the dropdown aspect of a combo. Or when I do it
on a combo, I get the second column in the drop down and the first in
the permanent display.

I want to display an integer value, with some explanatory text.

Gtk.ComboBox combobox = Gtk.ComboBox.NewText();
Gtk.CellRendererText cell = new Gtk.CellRendererText();
combobox.PackStart(cell, true);
combobox.AddAttribute(cell, "text", 0);
combobox.AddAttribute(cell, "text", 1);

Gtk.ListStore store = new Gtk.ListStore(typeof(int), typeof(string));
combobox.Model = store;

for (int i = 0; i < 4; ++i)
{
  store.AppendValues(i, "item "+i.Tostring());
}

GtkTreeIter iter;
combobox.Model.GetIterFirst(out iter);
combobox.Model.SetActiveIter(iter);


Vladimir Giszpenc wrote:
> Dan,
> 
> Here is how I set a default:
> 
>                       ListStore store = new ListStore(typeof (string));
>                       this.cboLogLevel.Model = store;
>                       TreeIter iter = 
> store.AppendValues(LogLevel.Debug.ToString());
>                       this.cboLogLevel.SetActiveIter(iter);
> 
> Vlad
> 
_______________________________________________
Gtk-sharp-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

Reply via email to