seoz pushed a commit to branch master.

http://git.enlightenment.org/tools/elm-theme-viewer.git/commit/?id=c40d90d64b84f1940b01dd2881335374c5073387

commit c40d90d64b84f1940b01dd2881335374c5073387
Author: Daniel Juyung Seo <[email protected]>
Date:   Thu Aug 21 23:20:00 2014 +0900

    widget: added selected callback for genlist items.
---
 src/bin/widget.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/bin/widget.c b/src/bin/widget.c
index a6f3282..f38d00e 100644
--- a/src/bin/widget.c
+++ b/src/bin/widget.c
@@ -806,6 +806,13 @@ _widget_genlist_content_get(void *data EINA_UNUSED, 
Evas_Object *obj,
    return o;
 }
 
+static void
+_genlist_item_sel_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
+                     void *event_info)
+{
+   printf("Item %p is selected\n", event_info);
+}
+
 static Evas_Object *
 _widget_genlist_create(Evas_Object *parent, const char *orig_style, const char 
*style)
 {
@@ -847,7 +854,7 @@ _widget_genlist_create(Evas_Object *parent, const char 
*orig_style, const char *
    for (i = 0; i < 50; i++)
      {
         elm_genlist_item_append(o, ic, (void *)(long)i, NULL, item_type,
-                                NULL, NULL);
+                                _genlist_item_sel_cb, NULL);
      }
 
    elm_genlist_item_class_free(ic);

-- 


Reply via email to