Index: gtk/gtkcombobox.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkcombobox.c,v
retrieving revision 1.138.2.8
diff -u -r1.138.2.8 gtkcombobox.c
--- gtk/gtkcombobox.c	6 Apr 2005 04:00:55 -0000	1.138.2.8
+++ gtk/gtkcombobox.c	8 Apr 2005 00:33:12 -0000
@@ -285,6 +285,8 @@
 
 static void     gtk_combo_box_check_appearance     (GtkComboBox      *combo_box);
 static gchar *  gtk_combo_box_real_get_active_text (GtkComboBox      *combo_box);
+static void     gtk_combo_box_real_set_active_text (GtkComboBox      *combo_box,
+						    const gchar      *text);
 
 /* listening to the model */
 static void     gtk_combo_box_model_row_inserted   (GtkTreeModel     *model,
@@ -493,6 +495,7 @@
   binding_set = gtk_binding_set_by_class (klass);
 
   klass->get_active_text = gtk_combo_box_real_get_active_text;
+  klass->set_active_text = gtk_combo_box_real_set_active_text;
 
   container_class = (GtkContainerClass *)klass;
   container_class->forall = gtk_combo_box_forall;
@@ -4782,6 +4785,88 @@
   return text;
 }
 
+/**
+ * gtk_combo_box_set_active_text:
+ * @combo_box: A #GtkComboBox constructed with gtk_combo_box_new_text().
+ * @text: string containing the desired active text. %NULL to unselect.
+ *
+ * Sets the currently active item in @combo_box to @text.  If @text does
+ * not match an existing text item stored in @combo_box or if @text is %NULL,
+ * the combo box will be placed in the unselected state.  Note that you can
+ * only use this function with combo boxes constructed with
+ * gtk_combo_box_new_text().
+ *
+ * Since: 2.8
+ */
+void
+gtk_combo_box_set_active_text (GtkComboBox *combo_box,
+			       const gchar *text)
+{
+  GtkComboBoxClass *class;
+
+  g_return_if_fail (GTK_IS_COMBO_BOX (combo_box));
+
+  class = GTK_COMBO_BOX_GET_CLASS (combo_box);
+
+  if (class->set_active_text)
+    (* class->set_active_text) (combo_box, text);
+
+}
+
+typedef struct {
+  const gchar *text;
+  GtkTreeIter  iter;
+  gboolean     found;
+} TextSearchData;
+
+static gboolean
+search_text_func (GtkTreeModel *model,
+		  GtkTreePath  *path,
+		  GtkTreeIter  *iter,
+		  gpointer      data)
+{
+  TextSearchData *search_data = (TextSearchData *)data;
+  gchar          *text = NULL;
+
+  gtk_tree_model_get (model, iter, 0, &text, -1);
+
+  if (strcmp (text,search_data->text) == 0) {
+    search_data->found = TRUE;
+    search_data->iter  = *iter;
+  }
+
+  g_free (text);
+  
+  return FALSE;
+}
+
+void
+gtk_combo_box_real_set_active_text (GtkComboBox *combo_box,
+				    const gchar *text)
+{
+  g_return_if_fail (GTK_IS_LIST_STORE (combo_box->priv->model));
+
+  if (!text) {
+
+    gtk_combo_box_set_active (combo_box, -1);
+
+  } else {
+    TextSearchData search_data;
+
+    search_data.text        = text;
+    search_data.found       = FALSE;
+
+    gtk_tree_model_foreach (combo_box->priv->model, search_text_func, &search_data);
+    if (search_data.found) {
+      gtk_combo_box_set_active_iter (combo_box, &search_data.iter);
+    } else {
+      gtk_combo_box_set_active (combo_box, -1);
+    }    
+
+  }
+
+}
+
 static gboolean
 gtk_combo_box_mnemonic_activate (GtkWidget *widget,
 				 gboolean   group_cycling)
Index: gtk/gtkcombobox.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkcombobox.h,v
retrieving revision 1.24.2.1
diff -u -r1.24.2.1 gtkcombobox.h
--- gtk/gtkcombobox.h	1 Apr 2005 20:57:20 -0000	1.24.2.1
+++ gtk/gtkcombobox.h	8 Apr 2005 00:33:12 -0000
@@ -54,6 +54,8 @@
 
   /* vfuncs */
   gchar *  (* get_active_text)  (GtkComboBox *combo_box);
+  void     (* set_active_text)  (GtkComboBox *combo_box,
+				 const gchar *text);
 
   /* Padding for future expansion */
   void (*_gtk_reserved0) (void);
@@ -117,6 +119,8 @@
 void          gtk_combo_box_remove_text      (GtkComboBox     *combo_box,
                                               gint             position);
 gchar        *gtk_combo_box_get_active_text  (GtkComboBox     *combo_box);
+void          gtk_combo_box_set_active_text  (GtkComboBox     *combo_box,
+					      const gchar     *text);
 
 /* programmatic control */
 void          gtk_combo_box_popup            (GtkComboBox     *combo_box);
