Evas_Object *gl = data;
static int i = 0;
- if (!itc1) itc1 = elm_genlist_item_class_new();
+ if (!itc1)
+ {
+ ERR("Genlist item class should not be null. Something very bad is happening!!");
+ return;
+ }
+
itc1->item_style = "default";
itc1->func.text_get = gl_text_get;
itc1->func.content_get = gl_content_get;
static int i = 0;
Elm_Object_Item *gli_selected;
- if (!itc1) itc1 = elm_genlist_item_class_new();
+ if (!itc1)
+ {
+ ERR("Genlist item class should not be null. Something very bad is happening!!");
+ return;
+ }
+
itc1->item_style = "default";
itc1->func.text_get = gl_text_get;
itc1->func.content_get = gl_content_get;
static int i = 0;
Elm_Object_Item *gli_selected;
- if (!itc1) itc1 = elm_genlist_item_class_new();
+ if (!itc1)
+ {
+ ERR("Genlist item class should not be null. Something very bad is happening!!");
+ return;
+ }
+
itc1->item_style = "default";
itc1->func.text_get = gl_text_get;
itc1->func.content_get = gl_content_get;
ecore_timer_add(1.2, my_gl_flush_delay, NULL);
}
+static void
+_genlist_del_cb(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__,
+ void *event_info __UNUSED__)
+{
+ if (!data) return;
+
+ elm_genlist_item_class_free(data);
+}
+
void
test_genlist2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
elm_box_pack_end(bx, bx3);
evas_object_show(bx3);
- /* 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_event_callback_add(gl, EVAS_CALLBACK_DEL, _genlist_del_cb, itc1);
evas_object_resize(win, 320, 320);
evas_object_show(win);