When I create a glade interface and add a simple ComboBox, GtkBuilder doesn't import the proper type of ComboBox.
There are two distinct types of ComboBoxes that are created like so:
Gtk::ComboBox.new(is_text_only = true)
or
Gtk::ComboBox.new(model)
From: http://ruby-gnome2.sourceforge.jp/hiki.cgi?Gtk::ComboBox
Even if there's no tag for "model" in the xml, GtkBuilder will still build the "model" type. I've verified that glade is working properly. For example, when I add a ListStore object in glade, it will add this line:
<property name="model">liststore1</property>
When I remove the object, this tag is gone. So the bug is exactly this: When GtkBuilder sees no tag indicating a model, it should create a simple combo box. Its the widget that people are looking for about 95% of the time. This bug is important because you can't change the type of the ComboBox at runtime. You're forced to learn all about the Treeview, ListView, Iter, paths etc. just to make a simple combobox.
Thanks,
Eric
Hi Eric,
I can confirm this bug - Gtk::Builder always builds a model combobox. Anyway, this is easily bypassable by creating a listmodel with only one column which you will then fill with strings.
Since I know you're using Freightrain :-) : you can skip all of this, just expose an array of strings on your viewmodel and bind it to the 'elements' property of the combobox. Don't look for the elements property on the API reference - there's no such thing, it's added to all combobox (and listviews and such) by freightrain. Here ( http://gist.github.com/630911 ) is an example on how to do that.
HTH,
Andrea