Getting index and list name from selected genlist item

how to set genlist index and list name, and get them through *event_info at Evas_Smart_Cb
typedef struct _item_data
{
	int index;
	char *list_name;
	Elm_Object_Item *item;
} item_data;

.
.
.

item_data *id;
.
.
.

id = calloc(sizeof(item_data), 1);
id->list_name = bt_menu_list[index];
id->index = index++;
id->item = elm_genlist_item_append(genlist, itc, id, NULL, ELM_GENLIST_ITEM_NONE, _evas_smart_cb, ad);

.
.
.
.
static void _evas_smart_cb(void *data, Evas_Object *obj, void *event_info)
{
	Elm_Object_Item *it = event_info;
	item_data *list = elm_object_item_data_get(it);

	dlog_print(DLOG_ERROR, LOG_TAG, "@@@ index = %d, list name = %s", list->index, list->list_name);
}

Responses

0 Replies