aboutsummaryrefslogtreecommitdiffstats
path: root/src/examples/elementary/hoversel_example_01.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/examples/elementary/hoversel_example_01.c')
-rw-r--r--src/examples/elementary/hoversel_example_01.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/examples/elementary/hoversel_example_01.c b/src/examples/elementary/hoversel_example_01.c
index 289996cf24..7ce97bb503 100644
--- a/src/examples/elementary/hoversel_example_01.c
+++ b/src/examples/elementary/hoversel_example_01.c
@@ -4,7 +4,6 @@
#include <Elementary.h>
static void _print_items(void *data, Evas_Object *obj, void *event_info);
-static void _free(void *data, Evas_Object *obj, void *event_info);
static void _add_item(void *data, Evas_Object *obj, void *event_info);
static void
@@ -108,21 +107,12 @@ static void
_add_item(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
{
static int num = 0;
- char *str = malloc(sizeof(char) * 11);
- Elm_Object_Item *hoversel_it;
+ Eina_Slstr *str;
if(is_eng)
- snprintf(str, 11, "item %d", ++num);
+ str = eina_slstr_printf("item %d", ++num);
else
- snprintf(str, 11, "بند %d", ++num);
-
- hoversel_it = elm_hoversel_item_add(obj, str, NULL, ELM_ICON_NONE, NULL,
- str);
- elm_object_item_del_cb_set(hoversel_it, _free);
-}
+ str = eina_slstr_printf("بند %d", ++num);
-static void
-_free(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
-{
- free(data);
+ elm_hoversel_item_add(obj, str, NULL, ELM_ICON_NONE, NULL, str);
}