summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2010-10-29 12:28:42 -0400
committerMatthias Clasen <mclasen@redhat.com>2010-10-29 12:28:42 -0400
commitac3fe174f7497a743bc01b6f699ebb740706d488 (patch)
treeb5a80f5e235bd705e3dc8fc7ab6d6b4dfbcbee17 /gtk
parent8b512bd9dd4c16abb27d18dc40b32b6c0545fff5 (diff)
downloadgtk+-ac3fe174f7497a743bc01b6f699ebb740706d488.tar.gz
GtkComboBox: Add a constructor that takes a model and adds an entry
https://bugzilla.gnome.org/show_bug.cgi?id=633050
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtk.symbols1
-rw-r--r--gtk/gtkcombobox.c17
-rw-r--r--gtk/gtkcombobox.h9
3 files changed, 23 insertions, 4 deletions
diff --git a/gtk/gtk.symbols b/gtk/gtk.symbols
index 6ae374f013..26b99be38e 100644
--- a/gtk/gtk.symbols
+++ b/gtk/gtk.symbols
@@ -821,6 +821,7 @@ gtk_combo_box_get_wrap_width
gtk_combo_box_new
gtk_combo_box_new_with_entry
gtk_combo_box_new_with_model
+gtk_combo_box_new_with_model_and_entry
gtk_combo_box_popdown
gtk_combo_box_popup
gtk_combo_box_popup_for_device
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
index c17326e3df..d5ec3e757b 100644
--- a/gtk/gtkcombobox.c
+++ b/gtk/gtkcombobox.c
@@ -4883,6 +4883,23 @@ gtk_combo_box_new_with_model (GtkTreeModel *model)
}
/**
+ * gtk_combo_box_new_with_model_and_entry:
+ *
+ * Creates a new empty #GtkComboBox with an entry
+ * and with the model initialized to @model.
+ *
+ * Return value: A new #GtkComboBox
+ */
+GtkWidget *
+gtk_combo_box_new_with_model_and_entry (GtkTreeModel *model)
+{
+ return g_object_new (GTK_TYPE_COMBO_BOX,
+ "has-entry", TRUE,
+ "model", model,
+ NULL);
+}
+
+/**
* gtk_combo_box_get_wrap_width:
* @combo_box: A #GtkComboBox
*
diff --git a/gtk/gtkcombobox.h b/gtk/gtkcombobox.h
index c5b6a3c1e0..c8931eb3b3 100644
--- a/gtk/gtkcombobox.h
+++ b/gtk/gtkcombobox.h
@@ -65,10 +65,11 @@ struct _GtkComboBoxClass
/* construction */
-GType gtk_combo_box_get_type (void) G_GNUC_CONST;
-GtkWidget *gtk_combo_box_new (void);
-GtkWidget *gtk_combo_box_new_with_entry (void);
-GtkWidget *gtk_combo_box_new_with_model (GtkTreeModel *model);
+GType gtk_combo_box_get_type (void) G_GNUC_CONST;
+GtkWidget *gtk_combo_box_new (void);
+GtkWidget *gtk_combo_box_new_with_entry (void);
+GtkWidget *gtk_combo_box_new_with_model (GtkTreeModel *model);
+GtkWidget *gtk_combo_box_new_with_model_and_entry (GtkTreeModel *model);
/* grids */
gint gtk_combo_box_get_wrap_width (GtkComboBox *combo_box);