2 * Simple Elementary's <b>list widget</b> example, illustrating its
5 * See stdout/stderr for output. Compile with:
8 * gcc -g `pkg-config --cflags --libs elementary` list_example_01.c -o list_example_01
12 #include <Elementary.h>
14 # include "elementary_config.h"
20 _on_done(void *data __UNUSED__,
21 Evas_Object *obj __UNUSED__,
22 void *event_info __UNUSED__)
28 elm_main(int argc __UNUSED__, char **argv __UNUSED__)
30 Evas_Object *win, *bg, *bx, *li;
32 static const char *lbl[] =
43 win = elm_win_add(NULL, "list", ELM_WIN_BASIC);
44 elm_win_title_set(win, "List Example");
45 evas_object_smart_callback_add(win, "delete,request", _on_done, NULL);
48 elm_win_resize_object_add(win, bg);
49 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
52 bx = elm_box_add(win);
53 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
54 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
55 elm_win_resize_object_add(win, bx);
58 li = elm_list_add(win);
59 evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
60 evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
61 elm_box_pack_end(bx, li);
62 for (i = 0; i < sizeof(lbl) / sizeof(lbl[0]); i++)
63 elm_list_item_append(li, lbl[i], NULL, NULL, NULL, NULL);
68 evas_object_resize(win, 320, 240);
69 evas_object_show(win);