aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/elementary/test_gengrid.c
diff options
context:
space:
mode:
authorDave Andreoli <dave@gurumeditation.it>2016-08-09 11:58:23 +0200
committerDave Andreoli <dave@gurumeditation.it>2016-08-09 11:59:18 +0200
commitf0293f9f0f20b3f0894ca46a1143361437141e46 (patch)
treea8e92c5f54d6adae81bbac8573f077df00d22749 /src/bin/elementary/test_gengrid.c
parentedje_pick: don't copy dependencies group if they in the import list (diff)
downloadefl-f0293f9f0f20b3f0894ca46a1143361437141e46.tar.gz
Add a test for elm_gengrid_item_all_contents_unset()
The function is good, and the test works as expected, I have written this because I have problems in pyefl with this function
Diffstat (limited to 'src/bin/elementary/test_gengrid.c')
-rw-r--r--src/bin/elementary/test_gengrid.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/bin/elementary/test_gengrid.c b/src/bin/elementary/test_gengrid.c
index f1768e4a76..2c1ea559c1 100644
--- a/src/bin/elementary/test_gengrid.c
+++ b/src/bin/elementary/test_gengrid.c
@@ -544,6 +544,29 @@ _btn_show_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info
elm_gengrid_item_show(it, ELM_GENGRID_ITEM_SCROLLTO_IN);
}
+static void
+_btn_item_contents_unset_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ api_data *api = data;
+ Eina_List *l = NULL;
+ Evas_Object *o;
+ Elm_Object_Item *it;
+
+ if (!api || !api->grid) return;
+
+ it = elm_gengrid_selected_item_get(api->grid);
+ if (!it) return;
+
+ elm_gengrid_item_all_contents_unset(it, &l);
+ EINA_LIST_FREE(l, o)
+ {
+ evas_object_move(o, 0, 0);
+ evas_object_show(o);
+ }
+ // Now all the unsetted object are orphan in the canvas,
+ // the user should do something with them
+}
+
void
test_gengrid(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
@@ -660,6 +683,12 @@ test_gengrid(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i
elm_box_pack_end(bx, bt);
evas_object_show(bt);
+ bt = elm_button_add(win);
+ elm_object_text_set(bt, "Item contents unset");
+ evas_object_smart_callback_add(bt, "clicked", _btn_item_contents_unset_cb, api);
+ elm_box_pack_end(bx, bt);
+ evas_object_show(bt);
+
evas_object_resize(win, 600, 600);
evas_object_show(win);
}