]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Set "entry-text-column" on our combo boxes.
authorSimon Tatham <anakin@pobox.com>
Sun, 6 Dec 2015 07:23:59 +0000 (07:23 +0000)
committerSimon Tatham <anakin@pobox.com>
Sun, 6 Dec 2015 07:23:59 +0000 (07:23 +0000)
When we provide an editable text box with a drop-down list of useful
preset values, such as the one full of character sets in the
Translation panel, we implement it on GTK 2.4+ as a GtkComboBox
pointing at a two-column GtkListStore, in which the second column is
the actual text (the first being a numeric id). Therefore, we need to
set the "entry-text-column" property to tell GtkComboBox which of
those columns to look in for the value corresponding to the edit-box
text.

Thanks to Robert de Bath for spotting the problem and tracing it as
far as commit 5fa22495c. That commit replaced a widget construction
call via gtk_combo_box_entry_new_with_model() with one using the newer
gtk_combo_box_new_with_model_and_entry(), overlooking the fact that
the former provided the text column number as a parameter, and the
latter didn't.

unix/gtkdlg.c

index 573111aeede967676f5f2d6c4a86c87c43226046..0bde6053c8f85f3e3bbb4cedd8bde16a6ab78826 100644 (file)
@@ -2083,6 +2083,8 @@ GtkWidget *layout_ctrls(struct dlgparam *dp, struct Shortcuts *scs,
                                                       G_TYPE_STRING);
                    w = gtk_combo_box_new_with_model_and_entry
                        (GTK_TREE_MODEL(uc->listmodel));
+                    g_object_set(G_OBJECT(w), "entry-text-column", 1,
+                                 (const char *)NULL);
                    /* We cannot support password combo boxes. */
                    assert(!ctrl->editbox.password);
                    uc->combo = w;