From: Simon Tatham Date: Sun, 6 Dec 2015 07:23:59 +0000 (+0000) Subject: Set "entry-text-column" on our combo boxes. X-Git-Tag: 0.68~304 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=45d5aacbfa416d4c585539a76c5b046c8f143401;p=PuTTY.git Set "entry-text-column" on our combo boxes. 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. --- diff --git a/unix/gtkdlg.c b/unix/gtkdlg.c index 573111ae..0bde6053 100644 --- a/unix/gtkdlg.c +++ b/unix/gtkdlg.c @@ -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;