PATCH for gtk_combo_set_popdown_strings BUG



Todd Dukes wrote:
> 
> Is it the intent that setting the popdown strings clears
> the combo entry?
> 
> If so, is there a good argument for doing so?
> 
> To see this behavior swap the following two lines in testgtk.c
> 
> 2789:    gtk_combo_set_popdown_strings (GTK_COMBO (cb), cbitems);
> 2790:    gtk_entry_set_text (GTK_ENTRY (GTK_COMBO(cb)->entry), "hello
> world");
> 
> If no one objects. I will try to modify the behavior of
> set_popdown_strings
> to leave the entry alone unless value_in_list is true.
> 
> thanks,
> Todd.
> --
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null


Here is a patch that makes the symptom go away. Would someone more
familiar take a look at it. 

thanks,
Todd.

--- gtkcombo.c.1.2.3	Wed Feb 24 04:14:57 1999
+++ gtkcombo.c	Fri Jul 30 17:02:48 1999
@@ -817,7 +818,11 @@
   g_return_if_fail (strings != NULL);
 
   gtk_list_clear_items (GTK_LIST (combo->list), 0, -1);
+
   list = strings;
+
+  gtk_signal_handler_block ( combo->list, combo->list_change_id );
+
   while (list)
     {
       li = gtk_list_item_new_with_label ((gchar *) list->data);
@@ -825,6 +830,7 @@
       gtk_container_add (GTK_CONTAINER (combo->list), li);
       list = list->next;
     }
+  gtk_signal_handler_unblock ( combo->list, combo->list_change_id );
 }
 
 static void

-- 
   | Todd Dukes                      E-MAIL:  tdukes@ibmoto.com |
   | Motorola Somerset                  Phone:   (512) 424-8008 |
   | 6200 Bridgepoint Parkway Building #4 MS OE70               |
   | Austin, Texas 78730                                        |



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]