]> Pileus Git - ~andy/gtk/commitdiff
Add back the monitoring of the selection when the combo isn't popped down;
authorOwen Taylor <otaylor@redhat.com>
Wed, 4 Dec 2002 18:07:08 +0000 (18:07 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Wed, 4 Dec 2002 18:07:08 +0000 (18:07 +0000)
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)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkcombo.c

index 5867638ce65b269d6909459e1da296c56d73ef1e..210f4ad9a16ac9781f55cf040e019cd602ae313a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+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)
+
 Tue Dec  3 17:47:24 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gdk/x11/gdkgeometry-x11.c (gdk_window_guffaw_scroll): Fix wrong 
index 5867638ce65b269d6909459e1da296c56d73ef1e..210f4ad9a16ac9781f55cf040e019cd602ae313a 100644 (file)
@@ -1,3 +1,12 @@
+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)
+
 Tue Dec  3 17:47:24 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gdk/x11/gdkgeometry-x11.c (gdk_window_guffaw_scroll): Fix wrong 
index 5867638ce65b269d6909459e1da296c56d73ef1e..210f4ad9a16ac9781f55cf040e019cd602ae313a 100644 (file)
@@ -1,3 +1,12 @@
+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)
+
 Tue Dec  3 17:47:24 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gdk/x11/gdkgeometry-x11.c (gdk_window_guffaw_scroll): Fix wrong 
index 5867638ce65b269d6909459e1da296c56d73ef1e..210f4ad9a16ac9781f55cf040e019cd602ae313a 100644 (file)
@@ -1,3 +1,12 @@
+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)
+
 Tue Dec  3 17:47:24 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gdk/x11/gdkgeometry-x11.c (gdk_window_guffaw_scroll): Fix wrong 
index 5867638ce65b269d6909459e1da296c56d73ef1e..210f4ad9a16ac9781f55cf040e019cd602ae313a 100644 (file)
@@ -1,3 +1,12 @@
+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)
+
 Tue Dec  3 17:47:24 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gdk/x11/gdkgeometry-x11.c (gdk_window_guffaw_scroll): Fix wrong 
index 5867638ce65b269d6909459e1da296c56d73ef1e..210f4ad9a16ac9781f55cf040e019cd602ae313a 100644 (file)
@@ -1,3 +1,12 @@
+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)
+
 Tue Dec  3 17:47:24 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gdk/x11/gdkgeometry-x11.c (gdk_window_guffaw_scroll): Fix wrong 
index ba368797cde47d8f3c753a794ed7113157002a17..35734d70f1affa99d6019319d35b7d2213a23f4d 100644 (file)
@@ -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",