After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 165411 - Combo box items entered in Glade do not show up in derived widget at runtime
Combo box items entered in Glade do not show up in derived widget at runtime
Status: RESOLVED FIXED
Product: libglademm
Classification: Other
Component: general
git master
Other All
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2005-01-27 15:20 UTC by Ney André de Mello Zunino
Modified: 2011-01-16 23:33 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Ney André de Mello Zunino 2005-01-27 15:20:01 UTC
Please describe the problem:
My application's UI is wholly designed in Glade and I would rather not have to
resort to code for any reason. In one dialog window, I needed a simple combo box
widget. I quickly realized that Gtk::ComboBoxText was the most appropriate one
for my need. So I created a class derived from Gtk::ComboBoxText and gave it the
special-form constructor in order to be able to use libglademm's
get_widget_derived(). The widget is actually found and retrieved; however, the
items entered on the Glade interface do not show up. It seems like the combo
box's popup menu is empty.

Steps to reproduce:
1. In Glade, add a combo box to a window and enter some items for it.
2. Derive a class from Gtk::ComboBoxText.
3. Use get_widget_derived() to load the widget into a pointer variable of the
above defined class.


Actual results:
The items defined in Glade do not show up; i.e,, when the combo box is
activated, an empty popup is shown.

Expected results:
The popup shown when the combo box is activated should contain the items defined
in Glade.

Does this happen every time?
Yes.

Other information:
Entering the items in code, via Gtk::ComboBoxText::append_text() does make them
show up. However, for some reason, they come off doubled, i.e. the same item
appears twice on each row. I will file another bug report on that.
Comment 1 Murray Cumming 2005-02-01 17:56:44 UTC
The problem here is that GtkComboBox::Text has a model but Glade is adding
another model. I have added this text to the Gtk::ComboBoxText documentation:

* Note that you can not use this class with
Gnome::Glade::Xml::get_widget_derived() to wrap a GtkComboBox added 
* in the Glade user interface designer, because Glade adds its own TreeModel
instead of using the TreeModel from 
* this class. You could use a normal Gtk::ComboBox instead, though you can not
use Glade to add rows to a TreeModel that is defined in your C++ code.

> Gtk::ComboBoxText::append_text() does make them show up.
I am surprised, and I think that valgrind would report some strange uses of memory.