summaryrefslogtreecommitdiff
path: root/gtk/gtkgrid.c
diff options
context:
space:
mode:
authorDenis Washington <denisw@online.de>2011-08-30 08:38:03 +0200
committerDenis Washington <denisw@online.de>2011-08-30 08:38:03 +0200
commitcea54613538ffaa0a2cf2326de1822f740de1361 (patch)
treec18de79055af8c6466ab882ac1f257c93c316311 /gtk/gtkgrid.c
parentc2107aebe708d44e04a34f9549c110a82cce5153 (diff)
parent143f943905fc75cb5888011b641e447ee5c75037 (diff)
downloadgtk+-gtkbuilder-gbinding-transform.tar.gz
Merge branch 'gtkbuilder-gbinding' into gtkbuilder-gbinding-transformgtkbuilder-gbinding-transform
Diffstat (limited to 'gtk/gtkgrid.c')
-rw-r--r--gtk/gtkgrid.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/gtk/gtkgrid.c b/gtk/gtkgrid.c
index 20ec688294..cfb21f41ba 100644
--- a/gtk/gtkgrid.c
+++ b/gtk/gtkgrid.c
@@ -1480,6 +1480,42 @@ gtk_grid_attach_next_to (GtkGrid *grid,
}
/**
+ * gtk_grid_get_child_at:
+ * @grid: a #GtkGrid
+ * @left: the left edge of the cell
+ * @top: the top edge of the cell
+ *
+ * Gets the child of @grid whose area covers the grid
+ * cell whose upper left corner is at @left, @top.
+ *
+ * Returns: the child at the given position, or %NULL
+ *
+ * Since: 3.2
+ */
+GtkWidget *
+gtk_grid_get_child_at (GtkGrid *grid,
+ gint left,
+ gint top)
+{
+ GtkGridPrivate *priv = grid->priv;
+ GtkGridChild *child;
+ GList *list;
+
+ for (list = priv->children; list; list = list->next)
+ {
+ child = list->data;
+
+ if (CHILD_LEFT (child) <= left &&
+ CHILD_LEFT (child) + CHILD_WIDTH (child) > left &&
+ CHILD_TOP (child) <= top &&
+ CHILD_TOP (child) + CHILD_HEIGHT (child) > top)
+ return child->widget;
+ }
+
+ return NULL;
+}
+
+/**
* gtk_grid_insert_row:
* @grid: a #GtkGrid
* @position: the position to insert the row at