i think index should start from 0 for the programmatic convenient. why did u change suddenly?
------------------------------------ -Regards, Hermet- -----Original Message----- From: "Daniel Juyung Seo"<[email protected]> To: <[email protected]>; Cc: Sent: 2015-02-12 (목) 22:05:20 Subject: [EGIT] [core/elementary] master 01/01: genlist: Fix elm_genlist_item_index_get. seoz pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=e2fb6483c31ff82e6828f32d53311d7d4960ca4a commit e2fb6483c31ff82e6828f32d53311d7d4960ca4a Author: Daniel Juyung Seo <[email protected]> Date: Thu Feb 12 22:01:59 2015 +0900 genlist: Fix elm_genlist_item_index_get. The first item's index is 1 not 0. @fix --- src/bin/test_genlist.c 3 ++- src/lib/elm_genlist.c 2 +- src/lib/elm_genlist_item.eo 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/bin/test_genlist.c b/src/bin/test_genlist.c index 0849f12..3cce7ff 100644 --- a/src/bin/test_genlist.c +++ b/src/bin/test_genlist.c @@ -211,7 +211,8 @@ Eina_Bool gl_state_get(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, con static void gl_sel(void *data, Evas_Object *obj, void *event_info) { - printf("sel item data [%p] on genlist obj [%p], item pointer [%p]\n", data, obj, event_info); + printf("sel item data [%p] on genlist obj [%p], item pointer [%p], index [%d]\n", + data, obj, event_info, elm_genlist_item_index_get(event_info)); } static void diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c index 914468c..449e493 100644 --- a/src/lib/elm_genlist.c +++ b/src/lib/elm_genlist.c @@ -7037,7 +7037,7 @@ elm_genlist_item_cursor_engine_only_get(const Elm_Object_Item *eo_it) EOLIAN static int _elm_genlist_item_index_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it) { - int cnt = 0; + int cnt = 1; Elm_Gen_Item *tmp; ELM_GENLIST_ITEM_CHECK_OR_RETURN(it, -1); diff --git a/src/lib/elm_genlist_item.eo b/src/lib/elm_genlist_item.eo index bb44c42..9c6eecb 100644 --- a/src/lib/elm_genlist_item.eo +++ b/src/lib/elm_genlist_item.eo @@ -169,6 +169,8 @@ class Elm_Genlist_Item(Elm_Widget_Item) /*@ Get the index of the item. It is only valid once displayed. + The index start from 1. + @ingroup Genlist */ } -- ------------------------------------------------------------------------------ Dive into the World of Parallel Programming. The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ enlightenment-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
