[Gtk-sharp-list] Add data to ComboBox

Todd Berman tberman@off.net
Mon, 22 Nov 2004 10:13:18 -0800


On Mon, 2004-11-22 at 10:45 -0500, Dan Winship wrote:
> On Mon, 2004-11-22 at 06:54 -0500, Ryan wrote:
> > Just a few questions on Gtk.ComboBox in gtk-sharp 1.9.0.
> > 
> > How do you add data to it?
> 
> You need to create a TreeModel and either create the ComboBox with the
> TreeModel constructor, or set its Model property after creating it. Then
> you add things to the TreeModel, and they show up in the ComboBox. Note
> that I'm pretty sure that using TreeModel is currently really annoying,
> but Mike is working on that (but he's on vacation this week, so don't
> expect any progress until next week).
> 

There is also api somewhere to set it up by default to be the common
usecase. Which is a ComboBox with a single CellRendererText and a list
of strings. I believe that API is up and working if not, file a bug with
the C method that we dont properly expose.

--Todd