diff --git a/ChangeLog b/ChangeLog index 8d73c8e621..6187b603fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Fri Feb 27 21:42:28 2004 Matthias Clasen + + * gtk/gtkcombobox.c (gtk_combo_box_relayout): + * gtk/gtkcombobox.c (gtk_combo_box_style_set): Simplify, only + create a new setup if appearance actually changed. + * gtk/gtkcombobox.c (gtk_combo_box_cell_layout_clear): + * gtk/gtkcombobox.c (gtk_combo_box_get_cell_info): Make + these more robust. (#127623, Damon Chaplin) + Fri Feb 27 15:06:00 2004 Jonathan Blandford * gtk/gtkfilechooser.c (gtk_file_chooser_class_init): remove diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 8d73c8e621..6187b603fa 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,12 @@ +Fri Feb 27 21:42:28 2004 Matthias Clasen + + * gtk/gtkcombobox.c (gtk_combo_box_relayout): + * gtk/gtkcombobox.c (gtk_combo_box_style_set): Simplify, only + create a new setup if appearance actually changed. + * gtk/gtkcombobox.c (gtk_combo_box_cell_layout_clear): + * gtk/gtkcombobox.c (gtk_combo_box_get_cell_info): Make + these more robust. (#127623, Damon Chaplin) + Fri Feb 27 15:06:00 2004 Jonathan Blandford * gtk/gtkfilechooser.c (gtk_file_chooser_class_init): remove diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 8d73c8e621..6187b603fa 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,12 @@ +Fri Feb 27 21:42:28 2004 Matthias Clasen + + * gtk/gtkcombobox.c (gtk_combo_box_relayout): + * gtk/gtkcombobox.c (gtk_combo_box_style_set): Simplify, only + create a new setup if appearance actually changed. + * gtk/gtkcombobox.c (gtk_combo_box_cell_layout_clear): + * gtk/gtkcombobox.c (gtk_combo_box_get_cell_info): Make + these more robust. (#127623, Damon Chaplin) + Fri Feb 27 15:06:00 2004 Jonathan Blandford * gtk/gtkfilechooser.c (gtk_file_chooser_class_init): remove diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 8d73c8e621..6187b603fa 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,12 @@ +Fri Feb 27 21:42:28 2004 Matthias Clasen + + * gtk/gtkcombobox.c (gtk_combo_box_relayout): + * gtk/gtkcombobox.c (gtk_combo_box_style_set): Simplify, only + create a new setup if appearance actually changed. + * gtk/gtkcombobox.c (gtk_combo_box_cell_layout_clear): + * gtk/gtkcombobox.c (gtk_combo_box_get_cell_info): Make + these more robust. (#127623, Damon Chaplin) + Fri Feb 27 15:06:00 2004 Jonathan Blandford * gtk/gtkfilechooser.c (gtk_file_chooser_class_init): remove diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 8d73c8e621..6187b603fa 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,12 @@ +Fri Feb 27 21:42:28 2004 Matthias Clasen + + * gtk/gtkcombobox.c (gtk_combo_box_relayout): + * gtk/gtkcombobox.c (gtk_combo_box_style_set): Simplify, only + create a new setup if appearance actually changed. + * gtk/gtkcombobox.c (gtk_combo_box_cell_layout_clear): + * gtk/gtkcombobox.c (gtk_combo_box_get_cell_info): Make + these more robust. (#127623, Damon Chaplin) + Fri Feb 27 15:06:00 2004 Jonathan Blandford * gtk/gtkfilechooser.c (gtk_file_chooser_class_init): remove diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c index 23956a1a87..9c67cac92c 100644 --- a/gtk/gtkcombobox.c +++ b/gtk/gtkcombobox.c @@ -580,21 +580,23 @@ gtk_combo_box_style_set (GtkWidget *widget, /* TRUE is windows style */ if (appearance) { + /* Destroy all the menu mode widgets, if they exist. */ if (GTK_IS_MENU (combo_box->priv->popup_widget)) - gtk_combo_box_menu_destroy (combo_box); - else - gtk_combo_box_unset_model (combo_box); - - gtk_combo_box_list_setup (combo_box); + gtk_combo_box_menu_destroy (combo_box); + + /* Create the list mode widgets, if they don't already exist. */ + if (!GTK_IS_TREE_VIEW (combo_box->priv->tree_view)) + gtk_combo_box_list_setup (combo_box); } else { + /* Destroy all the list mode widgets, if they exist. */ if (GTK_IS_TREE_VIEW (combo_box->priv->tree_view)) - gtk_combo_box_list_destroy (combo_box); - else - gtk_combo_box_unset_model (combo_box); - - gtk_combo_box_menu_setup (combo_box, TRUE); + gtk_combo_box_list_destroy (combo_box); + + /* Create the menu mode widgets, if they don't already exist. */ + if (!GTK_IS_MENU (combo_box->priv->popup_widget)) + gtk_combo_box_menu_setup (combo_box, TRUE); } } @@ -661,7 +663,7 @@ gtk_combo_box_get_cell_info (GtkComboBox *combo_box, { ComboCellInfo *info = (ComboCellInfo *)i->data; - if (info->cell == cell) + if (info && info->cell == cell) return info; } @@ -1395,6 +1397,9 @@ gtk_combo_box_menu_setup (GtkComboBox *combo_box, { GtkWidget *box; + /* Unset any existing model. */ + gtk_combo_box_unset_model (combo_box); + if (combo_box->priv->cell_view) { combo_box->priv->button = gtk_toggle_button_new (); @@ -1649,8 +1654,6 @@ gtk_combo_box_relayout (GtkComboBox *combo_box) /* ensure we are in menu style */ if (combo_box->priv->tree_view) gtk_combo_box_list_destroy (combo_box); - else - gtk_combo_box_unset_model (combo_box); menu = combo_box->priv->popup_widget; @@ -1835,6 +1838,9 @@ gtk_combo_box_list_setup (GtkComboBox *combo_box) GSList *i; GtkTreeSelection *sel; + /* Unset any existing model. */ + gtk_combo_box_unset_model (combo_box); + combo_box->priv->button = gtk_toggle_button_new (); gtk_widget_set_parent (combo_box->priv->button, GTK_BIN (combo_box)->child->parent); @@ -2260,6 +2266,7 @@ gtk_combo_box_cell_layout_clear (GtkCellLayout *layout) gtk_combo_box_cell_layout_clear_attributes (layout, info->cell); g_object_unref (G_OBJECT (info->cell)); g_free (info); + i->data = NULL; } g_slist_free (combo_box->priv->cells); combo_box->priv->cells = NULL;