aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/elementary/src/bin/test_gengrid.c
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2012-07-31 11:02:30 +0000
committerDaniel Juyung Seo <seojuyung2@gmail.com>2012-07-31 11:02:30 +0000
commit2ab8b0469da2608475794a6eee00207fff71d877 (patch)
tree62af64c450b7150217aecc804b27ca2c83efab79 /legacy/elementary/src/bin/test_gengrid.c
parentelm gengrid: Fixed item_show bug. (diff)
downloadefl-2ab8b0469da2608475794a6eee00207fff71d877.tar.gz
elm test_gengrid.c: Added bring_in/show buttons.
SVN revision: 74644
Diffstat (limited to 'legacy/elementary/src/bin/test_gengrid.c')
-rw-r--r--legacy/elementary/src/bin/test_gengrid.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/legacy/elementary/src/bin/test_gengrid.c b/legacy/elementary/src/bin/test_gengrid.c
index f9a07867a2..6607a8f8a8 100644
--- a/legacy/elementary/src/bin/test_gengrid.c
+++ b/legacy/elementary/src/bin/test_gengrid.c
@@ -466,6 +466,24 @@ cursor_bt_clicked(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *even
evas_object_show(win);
}
+static void
+_btn_bring_in_clicked_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
+{
+ if (!data) return;
+ Elm_Object_Item *it = elm_gengrid_selected_item_get(data);
+ if (!it) return;
+ elm_gengrid_item_bring_in(it, ELM_GENGRID_ITEM_SCROLLTO_IN);
+}
+
+static void
+_btn_show_clicked_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
+{
+ if (!data) return;
+ Elm_Object_Item *it = elm_gengrid_selected_item_get(data);
+ if (!it) return;
+ elm_gengrid_item_show(it, ELM_GENGRID_ITEM_SCROLLTO_IN);
+}
+
void
test_gengrid(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
@@ -558,6 +576,18 @@ test_gengrid(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_inf
elm_box_pack_end(bx, bt);
evas_object_show(bt);
+ bt = elm_button_add(win);
+ elm_object_text_set(bt, "Bring in");
+ evas_object_smart_callback_add(bt, "clicked", _btn_bring_in_clicked_cb, api->grid);
+ elm_box_pack_end(bx, bt);
+ evas_object_show(bt);
+
+ bt = elm_button_add(win);
+ elm_object_text_set(bt, "Show");
+ evas_object_smart_callback_add(bt, "clicked", _btn_show_clicked_cb, api->grid);
+ elm_box_pack_end(bx, bt);
+ evas_object_show(bt);
+
evas_object_resize(win, 600, 600);
evas_object_show(win);
}