GNOME Bugzilla – Bug 632381
gtk_combo_box_text_new_with_entry() adds two text cell renderers
Last modified: 2010-10-18 12:15:20 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.
(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.