Index: gtk/gtkcombobox.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkcombobox.c,v
retrieving revision 1.182
diff -u -p -r1.182 gtkcombobox.c
--- gtk/gtkcombobox.c	14 Aug 2006 20:12:10 -0000	1.182
+++ gtk/gtkcombobox.c	26 Dec 2006 14:13:05 -0000
@@ -291,6 +291,8 @@ static gboolean gtk_combo_box_key_press 
 
 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,
@@ -458,6 +460,7 @@ gtk_combo_box_class_init (GtkComboBoxCla
   GtkWidgetClass *widget_class;
 
   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;
@@ -4933,6 +4936,88 @@ gtk_combo_box_real_get_active_text (GtkC
 			0, &text, -1);
 
   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
Index: gtk/gtkcombobox.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkcombobox.h,v
retrieving revision 1.26
diff -u -p -r1.26 gtkcombobox.h
--- gtk/gtkcombobox.h	21 Nov 2005 16:01:49 -0000	1.26
+++ gtk/gtkcombobox.h	26 Dec 2006 14:13:05 -0000
@@ -54,6 +54,8 @@ struct _GtkComboBoxClass
 
   /* 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);
@@ -122,6 +124,8 @@ void          gtk_combo_box_prepend_text
 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);
