summaryrefslogtreecommitdiff
path: root/gtk/gtkentrycompletion.c
diff options
context:
space:
mode:
authorLars Uebernickel <lars@uebernic.de>2013-11-03 19:02:01 +0100
committerLars Uebernickel <lars@uebernic.de>2013-11-03 19:02:01 +0100
commita9a6fb045a0faedb30ffdad4ed979f380c483ebd (patch)
treeb55367635bd193bfdc907b35c1f47c659bdfc284 /gtk/gtkentrycompletion.c
parentc9892df362817c90b05678aef6a519f607c66692 (diff)
downloadgtk+-a9a6fb045a0faedb30ffdad4ed979f380c483ebd.tar.gz
gtk_entry_completion_get_cells: revert returning NULL
Too many applications and libraries depend on accessing the internally created cell renderer. Allow that again, but print a warning.
Diffstat (limited to 'gtk/gtkentrycompletion.c')
-rw-r--r--gtk/gtkentrycompletion.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/gtk/gtkentrycompletion.c b/gtk/gtkentrycompletion.c
index 37763f7649..f0f16fc827 100644
--- a/gtk/gtkentrycompletion.c
+++ b/gtk/gtkentrycompletion.c
@@ -844,20 +844,21 @@ gtk_entry_completion_clear_text_column_renderer (GtkEntryCompletion *completion)
static GList *
gtk_entry_completion_get_cells (GtkCellLayout *cell_layout)
{
- GtkEntryCompletion *completion = GTK_ENTRY_COMPLETION (cell_layout);
+ static gboolean warned = FALSE;
- if (completion->priv->text_column == -1)
- {
- GtkCellArea *area;
+ GtkEntryCompletion *completion = GTK_ENTRY_COMPLETION (cell_layout);
+ GtkCellArea *area;
- area = gtk_entry_completion_get_area (cell_layout);
- return gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (area));
- }
- else
+ if (!warned && completion->priv->text_column != -1)
{
- /* Don't expose the internally created cell renderer */
- return NULL;
+ g_warning ("GtkEntryCompletion: don't call gtk_cell_layout_get_cells() to get "
+ "the cell renderer that was created by setting 'text-column'.");
+ warned = TRUE;
}
+
+ area = gtk_entry_completion_get_area (cell_layout);
+
+ return gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (area));
}
static void
@@ -1475,6 +1476,9 @@ gtk_entry_completion_delete_action (GtkEntryCompletion *completion,
* to have a list displaying all (and just) strings in the completion list,
* and to get those strings from @column in the model of @completion.
*
+ * The cell renderer added by this function is managed internally. Do
+ * not access or modify it.
+ *
* Any cell renderers that were added to @completion before calling this
* function will be removed.
*