aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/elementary/src/bin/test_gengrid.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2011-10-21 04:04:03 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2011-10-21 04:04:03 +0000
commit82cf8ef9ff5bbda3f1f16cb2734e060ee158d3ce (patch)
tree209aa6a1a93c3488e8921b5d44d3b60236d2da08 /legacy/elementary/src/bin/test_gengrid.c
parentremove mode_item_style from item class, use genlist_mode_item_style_set() ins... (diff)
downloadefl-82cf8ef9ff5bbda3f1f16cb2734e060ee158d3ce.tar.gz
add delete button to gengrid test 2
SVN revision: 64229
Diffstat (limited to 'legacy/elementary/src/bin/test_gengrid.c')
-rw-r--r--legacy/elementary/src/bin/test_gengrid.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/legacy/elementary/src/bin/test_gengrid.c b/legacy/elementary/src/bin/test_gengrid.c
index 461cf11ab4..8c9dd28ad8 100644
--- a/legacy/elementary/src/bin/test_gengrid.c
+++ b/legacy/elementary/src/bin/test_gengrid.c
@@ -244,6 +244,19 @@ _after_bt_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UN
}
static void
+_delete_bt_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
+{
+ Evas_Object *grid = data;
+ Eina_List *l, *l2, *l3;
+ Elm_Gengrid_Item *it;
+
+ l = elm_gengrid_selected_items_get(grid);
+ if (!l) return;
+ EINA_LIST_FOREACH_SAFE(l, l2, l3, it)
+ elm_gengrid_item_del(it);
+}
+
+static void
_prepend_bt_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
Testitem *ti;
@@ -338,6 +351,12 @@ test_gengrid2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in
elm_box_pack_end(hbx, bt);
evas_object_show(bt);
+ bt = elm_button_add(win);
+ elm_object_text_set(bt, "Delete");
+ evas_object_smart_callback_add(bt, "clicked", _delete_bt_clicked, grid);
+ elm_box_pack_end(hbx, bt);
+ evas_object_show(bt);
+
bt = elm_spinner_add(win);
elm_spinner_min_max_set(bt, 10, 1024);
elm_spinner_value_set(bt, 150);