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 165416 - ComboBoxText items appended via code appearing doubled
ComboBoxText items appended via code appearing doubled
Status: RESOLVED INVALID
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:50 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:50:29 UTC
Please describe the problem:
As described in bug #165411, combo box items entered through the Glade interface
do not show up at runtime on a ComboBoxText derived widget. To try to get around
that issue, I decided to add the combo box items in code, using the
ComboBoxText::append_text() method. This time the items do show up, but not
properly. Each item appears twice on each row, as if there were two columns.

Steps to reproduce:
1. In Glade, add a combo box widget to a window.
2. Derive a class from Gtk::ComboBoxText.
3. Use get_widget_derived() to retrieve that widget.
4. Use Gtk::ComboBoxText::append_text() to add some items to the combo box.


Actual results:
The items added via append_text() appear twice per row on the combo box's popup
menu.

Expected results:
The items shoud appear only once per row.

Does this happen every time?
Yes.

Other information:
In one of my attempts, I modified the code to use a Gtk::ComboBox instead of a
Gtk::ComboBoxText and, consequently, substituted get_widget() for
get_widget_derived(). The items entered in Glade would now show up, but still
doubled. After some reading, I tried the set_wrap_width() method with an
argument of 1 and it solved the problem. However, for the present case with
Gtk::ComboBoxText, that same attempt did not help.

Another important piece of information which I have left out from the other
reports: all my tests are on a Windows XP SP2 machine, using the Microsoft C/C++
compiler which comes with Visual Studio .NET 2003 and Cedric Gustin's adapted
libraries [1].

[1]
http://www.pcpm.ucl.ac.be/~gustin/win32_ports/binaries/gtkmm-devel-2.4.8cvs-2.exe
Comment 1 Murray Cumming 2005-02-02 13:17:15 UTC
As explained in bug #165411, you can't use both Glade and ComboBoxText to add
items to a ComboBox.