aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/elementary/src/bin/test_gengrid.c
diff options
context:
space:
mode:
authorAmitesh Singh <amitesh.sh@samsung.com>2015-09-29 14:02:50 +0530
committerAmitesh Singh <amitesh.sh@samsung.com>2015-09-29 14:09:20 +0530
commitd22b8a172407a2f3f530fe1c6f43aef46d197834 (patch)
tree978d2f5dcebb9e2537a4893433caf8af87a219f0 /legacy/elementary/src/bin/test_gengrid.c
parentspinner: fix extra callback calls (diff)
downloadefl-d22b8a172407a2f3f530fe1c6f43aef46d197834.tar.gz
test_gengrid: Add test case for elm_gengrid_at_xy_item_get
Diffstat (limited to 'legacy/elementary/src/bin/test_gengrid.c')
-rw-r--r--legacy/elementary/src/bin/test_gengrid.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/legacy/elementary/src/bin/test_gengrid.c b/legacy/elementary/src/bin/test_gengrid.c
index e41f2127c2..523aaf3301 100644
--- a/legacy/elementary/src/bin/test_gengrid.c
+++ b/legacy/elementary/src/bin/test_gengrid.c
@@ -784,6 +784,21 @@ _gg_focus_item_select_on_focus_disable_changed_cb(void *data EINA_UNUSED,
elm_config_item_select_on_focus_disabled_set(elm_check_state_get(obj));
}
+static void
+_grid_mouse_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED,
+ Evas_Object *obj, void *event_info)
+{
+ Elm_Object_Item *it;
+ Evas_Event_Mouse_Down *m_info = event_info;
+
+ if (m_info->button == 1)
+ {
+ printf("mouse at (%d, %d), ", m_info->canvas.x, m_info->canvas.y);
+ it = elm_gengrid_at_xy_item_get(obj, m_info->canvas.x, m_info->canvas.y, NULL, NULL);
+ printf("Item found : %p\n", it);
+ }
+}
+
void
test_gengrid2(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
@@ -804,6 +819,8 @@ test_gengrid2(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_min_set(grid, 600, 500);
elm_box_pack_end(bx, grid);
+ evas_object_event_callback_add(grid, EVAS_CALLBACK_MOUSE_DOWN,
+ _grid_mouse_down_cb, NULL);
evas_object_show(grid);
hbx = elm_box_add(win);