}
// store callbacks to handle loading/parsing/freeing of store items from src
-static Elm_Genlist_Item_Class itc1 =
-{
- "message", { NULL, NULL, NULL, NULL}
-};
+static Elm_Genlist_Item_Class *itc1;
static const Elm_Store_Item_Mapping it1_mapping[] =
{
// choose the item genlist item class to use (only item style should be
// provided by the app, store will fill everything else in, so it also
// has to be writable
- info->base.item_class = &itc1; // based on item info - return the item class wanted (only style field used - rest reset to internal funcs store sets up to get label/icon etc)
+ info->base.item_class = itc1; // based on item info - return the item class wanted (only style field used - rest reset to internal funcs store sets up to get label/icon etc)
info->base.mapping = it1_mapping;
info->base.data = NULL; // if we can already parse and load all of item here and want to - set this
return EINA_TRUE; // return true to include this, false not to
if (myit->date) free(myit->date);
if (myit->head_content) free(myit->head_content);
free(myit);
- elm_store_item_data_set(sti, NULL);
}
void
evas_object_show(bx);
gl = elm_genlist_add(win);
- elm_genlist_height_for_width_mode_set(gl, EINA_TRUE);
+ elm_genlist_mode_set(gl, ELM_LIST_COMPRESS);
evas_object_smart_callback_add(gl, "selected", _st_selected, NULL);
evas_object_smart_callback_add(gl, "clicked,double", _st_double_clicked, NULL);
evas_object_smart_callback_add(gl, "longpressed", _st_longpress, NULL);
elm_box_pack_end(bx, gl);
evas_object_show(gl);
+ itc1 = elm_genlist_item_class_new();
+ itc1->item_style = "message";
+
st = elm_store_filesystem_new();
elm_store_list_func_set(st, _st_store_list, NULL);
elm_store_fetch_func_set(st, _st_store_fetch, NULL);
elm_store_target_genlist_set(st, gl);
elm_store_filesystem_directory_set(st, "./store");
+ /* item_class_ref is needed for itc1. some items can be added in callbacks */
+ elm_genlist_item_class_ref(itc1);
+ elm_genlist_item_class_free(itc1);
+
evas_object_resize(win, 480, 800);
evas_object_show(win);
}