summaryrefslogtreecommitdiff
path: root/gtk/gtkcombo.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2002-12-04 18:07:08 +0000
committerOwen Taylor <otaylor@src.gnome.org>2002-12-04 18:07:08 +0000
commitb295f552ee5e236cf3bb0777b078fc14c80a06d2 (patch)
treef674a8259b1abb4199bf3ac7f1b5b565a3771a92 /gtk/gtkcombo.c
parent31f6adf53532dd0adb2f11de846224e1f92af5c5 (diff)
downloadgtk+-b295f552ee5e236cf3bb0777b078fc14c80a06d2.tar.gz
Add back the monitoring of the selection when the combo isn't popped down;
Wed Dec 4 12:44:50 2002 Owen Taylor <otaylor@redhat.com> * gtk/gtkcombo.c (gtk_combo_selection_changed): Add back the monitoring of the selection when the combo isn't popped down; apparently people depended upon the side-effect where gtk_combo_set_popdown_strings() would wipe out the contents of the list when browse-mode autoselected the first item in the list. (#100347)
Diffstat (limited to 'gtk/gtkcombo.c')
-rw-r--r--gtk/gtkcombo.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gtk/gtkcombo.c b/gtk/gtkcombo.c
index ba368797cd..35734d70f1 100644
--- a/gtk/gtkcombo.c
+++ b/gtk/gtkcombo.c
@@ -671,6 +671,7 @@ gtk_combo_update_entry (GtkCombo * combo)
GtkList *list = GTK_LIST (combo->list);
char *text;
+ g_signal_handler_block (list, combo->list_change_id);
if (list->selection)
{
text = gtk_combo_func (GTK_LIST_ITEM (list->selection->data));
@@ -678,6 +679,15 @@ gtk_combo_update_entry (GtkCombo * combo)
text = "";
gtk_entry_set_text (GTK_ENTRY (combo->entry), text);
}
+ g_signal_handler_unblock (list, combo->list_change_id);
+}
+
+static void
+gtk_combo_selection_changed (GtkList *list,
+ GtkCombo *combo)
+{
+ if (!GTK_WIDGET_VISIBLE (combo->popwin))
+ gtk_combo_update_entry (combo);
}
static void
@@ -956,6 +966,9 @@ gtk_combo_init (GtkCombo * combo)
gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW (combo->popup)));
gtk_widget_show (combo->list);
+ combo->list_change_id = g_signal_connect (combo->list, "selection_changed",
+ G_CALLBACK (gtk_combo_selection_changed), combo);
+
g_signal_connect (combo->popwin, "key_press_event",
G_CALLBACK (gtk_combo_list_key_press), combo);
g_signal_connect (combo->popwin, "button_press_event",