+2008-12-13 Matthias Clasen <mclasen@redhat.com>
+
+ Bug 555560 – gtk_combo_box_set_active fails with no model
+
+ * gtk/gtkcombobox.c: Allow out-of-order setting of model and active.
+ Patch by Christian Dywan
+
2008-12-13 Matthias Clasen <mclasen@redhat.com>
Bug 558306 – Cannot build gdk (gtk+ 2.14.4) on Solaris 8
gint wrap_width;
GtkShadowType shadow_type;
+ gint active; /* Only temporary */
GtkTreeRowReference *active_row;
GtkWidget *tree_view;
priv->height = 0;
priv->wrap_width = 0;
+ priv->active = -1;
priv->active_row = NULL;
priv->col_column = -1;
priv->row_column = -1;
g_return_if_fail (GTK_IS_COMBO_BOX (combo_box));
g_return_if_fail (index_ >= -1);
+ if (combo_box->priv->model == NULL)
+ {
+ /* Save index, in case the model is set after the index */
+ combo_box->priv->active = index_;
+ return;
+ }
+
if (index_ != -1)
path = gtk_tree_path_new_from_indices (index_, -1);
gtk_cell_view_set_model (GTK_CELL_VIEW (combo_box->priv->cell_view),
combo_box->priv->model);
+ if (combo_box->priv->active != -1)
+ {
+ /* If an index was set in advance, apply it now */
+ gtk_combo_box_set_active (combo_box, combo_box->priv->active);
+ combo_box->priv->active = -1;
+ }
+
out:
gtk_combo_box_update_sensitivity (combo_box);