[Gtk-sharp-list] Add data to ComboBox

Sergio Duran Sergio Duran <sergioduran@gmail.com>
Wed, 15 Dec 2004 15:07:36 -0600


I should learn to search harder before posting, I always find the
solution after sending the emails, it was all because of Ryan's
suggestion to check pygtk.
Anyway, for the dull minded (like myself): this is a working sample of
a ComboBox:

			ComboBox cb = new ComboBox();
			ListStore ls = new ListStore(typeof(string));
			cb.Model=ls;
			CellRendererText text = new CellRendererText();
			cb.PackStart(text, true);
			cb.AddAttribute(text, "text", 0);	
			ls.AppendValues("hello");
			ls.AppendValues("world");


On Wed, 15 Dec 2004 15:01:22 -0600, Sergio Duran <sergioduran@gmail.com> wrote:
> How did you finally get it working? I'm having the same issue and I'm
> trying to get that to work, this is my sample:
> 
> ComboBox cb = new ComboBox();
> ListStore ls = new ListStore(typeof(string));
> cb.Model = ls;
> ls.AppendValues("Hello");
> ls.AppendValues("World");
> 
> The ComboBox is always empty, even though the ListStore contains the
> items (I checked)
> 
> 
> On Wed, 24 Nov 2004 01:34:58 -0500, Ryan <rthomp@sympatico.ca> wrote:
> > Thanks for the help everyone. I don't know if I did it right but I
> > figured most of it out finally using pygtk code as a sample. No I just
> > have an alignment problem but that's not important.
> >
> > RT
> > _______________________________________________
> > Gtk-sharp-list maillist  -  Gtk-sharp-list@lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
> >
>