#define N_ITEMS 30
-static Elm_Genlist_Item_Class _itc;
+static Elm_Genlist_Item_Class *_itc = NULL;
static char *
_item_label_get(void *data, Evas_Object *obj __UNUSED__, const char *part __UNUSED__)
elm_win_resize_object_add(win, bg);
evas_object_show(bg);
- _itc.item_style = "default";
- _itc.func.label_get = _item_label_get;
- _itc.func.content_get = _item_content_get;
- _itc.func.state_get = NULL;
- _itc.func.del = NULL;
+ if (!_itc)
+ {
+ _itc = elm_genlist_item_class_new();
+ _itc->item_style = "default";
+ _itc->func.text_get = _item_label_get;
+ _itc->func.content_get = _item_content_get;
+ _itc->func.state_get = NULL;
+ _itc->func.del = NULL;
+ }
list = elm_genlist_add(win);
for (i = 0; i < N_ITEMS; i++)
{
- elm_genlist_item_append(list, &_itc,
+ elm_genlist_item_append(list, _itc,
(void *)(long)i, NULL,
ELM_GENLIST_ITEM_NONE,
_item_sel_cb, NULL);