summaryrefslogtreecommitdiff
path: root/src/examples/elementary/list_example_02.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2016-03-23 12:56:14 -0700
committerCedric BAIL <cedric@osg.samsung.com>2016-03-23 13:24:41 -0700
commitc2a1c49ab2042f559b28e840e54feb8494888e0e (patch)
treec6eb110b7c479499854eede9d0c3ab0a80c9a11a /src/examples/elementary/list_example_02.c
parent9340855597e7e465435c69b6278650346688da14 (diff)
elementary: move all legacy files to their expected new location.
Diffstat (limited to 'src/examples/elementary/list_example_02.c')
-rw-r--r--src/examples/elementary/list_example_02.c66
1 files changed, 66 insertions, 0 deletions
diff --git a/src/examples/elementary/list_example_02.c b/src/examples/elementary/list_example_02.c
new file mode 100644
index 0000000000..19c21b6b49
--- /dev/null
+++ b/src/examples/elementary/list_example_02.c
@@ -0,0 +1,66 @@
1/**
2 * Elementary's <b>list widget</b> example, illustrating its
3 * usage and API.
4 *
5 * See stdout/stderr for output. Compile with:
6 *
7 * @verbatim
8 * gcc -g list_example_02.c -o list_example_02 `pkg-config --cflags --libs elementary`
9 * @endverbatim
10 */
11
12#include <Elementary.h>
13
14EAPI_MAIN int
15elm_main(int argc, char **argv)
16{
17 Evas_Object *win, *li;
18 unsigned int i;
19 static const char *lbl[] =
20 {
21 "Sunday",
22 "Monday",
23 "Tuesday",
24 "Wednesday",
25 "Thursday",
26 "Friday",
27 "Saturday"
28 };
29
30 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
31
32 win = elm_win_util_standard_add("list", "List Example");
33 elm_win_autodel_set(win, EINA_TRUE);
34
35 /* default */
36 li = elm_list_add(win);
37 evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
38 elm_win_resize_object_add(win, li);
39
40 for (i = 0; i < sizeof(lbl) / sizeof(lbl[0]); i++)
41 elm_list_item_append(li, lbl[i], NULL, NULL, NULL, NULL);
42
43 /* display horizontally and set compress mode */
44 elm_list_horizontal_set(li, EINA_TRUE);
45 elm_list_mode_set(li, ELM_LIST_COMPRESS);
46
47 /* enable multiple selection and always select */
48 elm_list_multi_select_set(li, EINA_TRUE);
49 elm_list_select_mode_set(li, ELM_OBJECT_SELECT_MODE_ALWAYS);
50
51 /* set bounce and scroller policy */
52 elm_scroller_bounce_set(li, EINA_TRUE, EINA_TRUE);
53 elm_scroller_policy_set(li, ELM_SCROLLER_POLICY_AUTO,
54 ELM_SCROLLER_POLICY_ON);
55
56 elm_list_go(li);
57 evas_object_show(li);
58
59 evas_object_resize(win, 320, 120);
60 evas_object_show(win);
61
62 elm_run();
63
64 return 0;
65}
66ELM_MAIN()