summaryrefslogtreecommitdiff
path: root/gtk/gtkcombobox.c
diff options
context:
space:
mode:
authorKristian Rietveld <kris@gtk.org>2007-09-07 11:02:04 +0000
committerKristian Rietveld <kristian@src.gnome.org>2007-09-07 11:02:04 +0000
commitd719605dacf008f249e6718197c8d7259384578e (patch)
tree7c3de2e303b7107367c9691e7207531f0a7c5737 /gtk/gtkcombobox.c
parent6cbb6928359c9fc649bf6634514b3d97d8d4b5c5 (diff)
downloadgtk+-d719605dacf008f249e6718197c8d7259384578e.tar.gz
implement missing get_cells method. (Spotted by Paolo Borelli).
2007-09-07 Kristian Rietveld <kris@gtk.org> * gtk/gtkcombobox.c (gtk_combo_box_cell_layout_init), (gtk_combo_box_cell_layout_get_cells): implement missing get_cells method. (Spotted by Paolo Borelli). svn path=/trunk/; revision=18747
Diffstat (limited to 'gtk/gtkcombobox.c')
-rw-r--r--gtk/gtkcombobox.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
index 6a440ff161..a8e4949d8a 100644
--- a/gtk/gtkcombobox.c
+++ b/gtk/gtkcombobox.c
@@ -408,6 +408,7 @@ static void gtk_combo_box_cell_layout_pack_start (GtkCellLayout
static void gtk_combo_box_cell_layout_pack_end (GtkCellLayout *layout,
GtkCellRenderer *cell,
gboolean expand);
+static GList *gtk_combo_box_cell_layout_get_cells (GtkCellLayout *layout);
static void gtk_combo_box_cell_layout_clear (GtkCellLayout *layout);
static void gtk_combo_box_cell_layout_add_attribute (GtkCellLayout *layout,
GtkCellRenderer *cell,
@@ -878,6 +879,7 @@ gtk_combo_box_cell_layout_init (GtkCellLayoutIface *iface)
{
iface->pack_start = gtk_combo_box_cell_layout_pack_start;
iface->pack_end = gtk_combo_box_cell_layout_pack_end;
+ iface->get_cells = gtk_combo_box_cell_layout_get_cells;
iface->clear = gtk_combo_box_cell_layout_clear;
iface->add_attribute = gtk_combo_box_cell_layout_add_attribute;
iface->set_cell_data_func = gtk_combo_box_cell_layout_set_cell_data_func;
@@ -4129,6 +4131,27 @@ gtk_combo_box_cell_layout_pack_end (GtkCellLayout *layout,
pack_end_recurse (combo_box->priv->popup_widget, cell, expand);
}
+static GList *
+gtk_combo_box_cell_layout_get_cells (GtkCellLayout *layout)
+{
+ GSList *list;
+ GList *retval = NULL;
+ GtkComboBox *combo_box;
+
+ g_return_val_if_fail (GTK_IS_COMBO_BOX (layout), NULL);
+
+ combo_box = GTK_COMBO_BOX (layout);
+
+ for (list = combo_box->priv->cells; list; list = list->next)
+ {
+ ComboCellInfo *info = (ComboCellInfo *)list->data;
+
+ retval = g_list_prepend (retval, info->cell);
+ }
+
+ return g_list_reverse (retval);
+}
+
static void
clear_recurse (GtkWidget *menu)
{