diff options
author | Kristian Rietveld <kris@gtk.org> | 2010-12-05 18:18:36 +0100 |
---|---|---|
committer | Kristian Rietveld <kris@gtk.org> | 2010-12-05 18:18:36 +0100 |
commit | d28cbd6e6db15a77929719d08e014f560c73b0ba (patch) | |
tree | 519285246cd1163a66c0d876ed63ae249b75f225 /gtk/gtktreeviewcolumn.c | |
parent | 2a6550176c8814ec297f52a25570b6127c480ffe (diff) | |
download | gtk+-d28cbd6e6db15a77929719d08e014f560c73b0ba.tar.gz |
Bring back _gtk_tree_view_column_get_cell_at_pos
The function has been re-implemented around GtkCellArea. This commits
also brings back the invocation of this function in
gtk_tree_view_button_press(). I shouldn't have removed this.
Diffstat (limited to 'gtk/gtktreeviewcolumn.c')
-rw-r--r-- | gtk/gtktreeviewcolumn.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/gtk/gtktreeviewcolumn.c b/gtk/gtktreeviewcolumn.c index bf1679e3b5..429ed577fb 100644 --- a/gtk/gtktreeviewcolumn.c +++ b/gtk/gtktreeviewcolumn.c @@ -1466,6 +1466,40 @@ _gtk_tree_view_column_get_edited_cell (GtkTreeViewColumn *column) return gtk_cell_area_get_edited_cell (priv->cell_area); } +GtkCellRenderer * +_gtk_tree_view_column_get_cell_at_pos (GtkTreeViewColumn *column, + gint x) +{ + GList *list; + GList *cell; + GtkCellRenderer *match = NULL; + GtkTreeViewColumnPrivate *priv = column->priv; + + list = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (column)); + for (cell = list; cell; cell = cell->next) + { + GdkRectangle zero_cell_area = { 0, }; + GdkRectangle allocation; + + gtk_cell_area_get_cell_allocation (priv->cell_area, + priv->cell_area_context, + priv->tree_view, + cell->data, + &zero_cell_area, + &allocation); + + if (allocation.x <= x && x <= allocation.x + allocation.width) + { + match = cell->data; + break; + } + } + + g_list_free (list); + + return match; +} + /* Public Functions */ |