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 632381 - gtk_combo_box_text_new_with_entry() adds two text cell renderers
gtk_combo_box_text_new_with_entry() adds two text cell renderers
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkComboBox
2.91.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2010-10-17 18:35 UTC by Kristian Rietveld
Modified: 2010-10-18 12:15 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Kristian Rietveld 2010-10-17 18:35:44 UTC
When one creates a GtkComboBoxText with an entry, either using g_object_new() or gtk_combo_box_text_new_with_entry(), two (text) cell renderers will be packed into the drop down list.  One by gtk_combo_box_text_init() and one by gtk_combo_box_constructor() since has_entry is TRUE.

I guess this should be fixed somehow.  I stumbled upon this when looking into removing the use of deprecated functions in some combo box examples, for example the combo box example in gtk-demo.  This is still using gtk_combo_box_append_text(), while I think it should be using a GtkComboBoxText with an entry and then the new gtk_combo_box_text_append_text().  As far as I can see, manual creation of the tree model and usage of g_object_new() is then no longer needed and can be done using gtk_combo_box_text_new_with_entry() instead.  Apart from gtk-demo, the following tests also seem affected: testcombo.c, testgtk.c (line 4004), testsock_common.c (line 147).

I would be glad to provide a patch for fixing up the examples, but I don't see a proper fix for the actual combo box issue so far and would leave that for the designers of the new API.
Comment 1 Kristian Rietveld 2010-10-18 08:07:45 UTC
(In reply to comment #0)
> I would be glad to provide a patch for fixing up the examples, but I don't see
> a proper fix for the actual combo box issue so far and would leave that for the
> designers of the new API.

I noticed that Christian Dywan just pushed a patch to fix up the examples.  You can now see this problem manifest itself in the editable combo box of the "Combo Box" demo in gtk3-demo.