GNOME Bugzilla – Bug 165416
ComboBoxText items appended via code appearing doubled
Last modified: 2011-01-16 23:33:42 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
As explained in bug #165411, you can't use both Glade and ComboBoxText to add items to a ComboBox.