How to update Genlist item class

staric void *item_class;

static void _device_selected_cb(void *data, Evas_Object *obj, void *event_info)
{
	Elm_Object_Item *it = event_info;
	
	// When genlist item which needs to be updated selected, 'Elm_Object_Item *it' should be stored to pointer variable
	// *item_class in order to use in the function 'update_list'.
	// This simple example to show how to get target Elm_object_Item pointer varible using static pointer variable.
	// But well designed application, you would utilize custom callback 
	// and message queue that stores callback function pointer and other pointer variables such as 'Elm_Object_Item *it' or 'void *user_data'.
	
	item_class = it;
.
.
.
}
	
	
//if any event occured or status changed, call 'update_list()' in the funtion where you want
update_list();
.
.
.


static void update_list()
{
	Elm_Genlist_Item_Class *_itc2 = elm_genlist_item_class_new();
	_itc2->item_style        = "2text";
	_itc2->func.text_get     = conn_menu_text_get;
	_itc2->func.del          = _gl_menu_del;

    Elm_Object_Item *it = (Elm_Object_Item *)item_class;
	elm_genlist_item_item_class_update(it, _itc2);
}

Responses

0 Replies