Hi,
we have a bug in the genlist widget, or ...
If you want delete an item from an genlist when the user select it. You
have
some complaints from valgrind and if you close the window, the process never
end. See attachment
Best regards
--
Michaƫl Bouchaud
#include <Elementary.h>
char *itcLabelGetCb(void *data, Evas_Object *obj, const char *part)
{
if (data)
return strdup("Item Click me and close window :)");
return strdup("Item");
}
static void test(void *data, Evas_Object *obj, void *event_info)
{
elm_object_item_del(event_info);
}
static void
_del(void *data, Evas_Object *obj, void *event_info)
{
elm_exit();
}
EAPI_MAIN int elm_main(int argc, char **argv)
{
Evas_Object *mainWindow = NULL, *bg;
Evas_Object *genlist = NULL;
Elm_Genlist_Item_Class *itc = NULL;
mainWindow = elm_win_add(NULL, "test", ELM_WIN_BASIC);
bg = elm_bg_add(mainWindow);
evas_object_smart_callback_add(mainWindow, "delete,request", _del, NULL);
elm_win_autodel_set(mainWindow, EINA_TRUE);
evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(mainWindow, bg);
evas_object_show(bg);
genlist = elm_genlist_add(mainWindow);
evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(genlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_win_resize_object_add(mainWindow, genlist);
itc = elm_genlist_item_class_new();
itc->item_style = "default";
itc->func.text_get = itcLabelGetCb;
itc->func.content_get = NULL;
itc->func.state_get = NULL;
itc->func.del = NULL;
elm_genlist_item_append(genlist, itc, NULL, NULL,
ELM_GENLIST_ITEM_NONE, NULL, NULL);
elm_genlist_item_append(genlist, itc, genlist, NULL,
ELM_GENLIST_ITEM_NONE, test, NULL);
evas_object_show(genlist);
evas_object_resize(mainWindow, 400, 480);
evas_object_show(mainWindow);
elm_run();
elm_genlist_item_class_free(itc);
elm_shutdown();
return EXIT_SUCCESS;
}
ELM_MAIN()
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel