[Gtk-sharp-list] Add data to ComboBox

Brian Pickles brianh@bsquaredsen.co.uk
Mon, 22 Nov 2004 18:40:38 +0000


Ryan wrote:
> Just a few questions on Gtk.ComboBox in gtk-sharp 1.9.0.
> 
> How do you add data to it?
> Is there any documentation on it as the Combo documentation is pretty 
> useless?
> And lastly - does it support being populated by an ArrayList?
> 
> RT
> _______________________________________________
> Gtk-sharp-list maillist  -  Gtk-sharp-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
> 

You can do this in Gtk# for Windows 1.0.2

Gtk.Widget w =  gxml.GetWidget("combo1");
combo1 = w as Gtk.Combo;
string[] list = new string[] {"English", "Maths", "Science"};
combo1.PopdownStrings = list;

Brian Pickles