[elm_index] bug fix: eina_list null check
[framework/uifw/elementary.git] / src / examples / separator_example_01.c
1 //Compile with:
2 //gcc -g separator_example_01.c -o separator_example_01 `pkg-config --cflags --libs elementary`
3
4 #include <Elementary.h>
5
6 EAPI_MAIN int
7 elm_main(int argc, char **argv)
8 {
9    Evas_Object *win, *bg, *bx, *rect, *separator;
10
11    win = elm_win_add(NULL, "separator", ELM_WIN_BASIC);
12    elm_win_title_set(win, "Separator");
13    elm_win_autodel_set(win, EINA_TRUE);
14    elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
15
16    bg = elm_bg_add(win);
17    elm_win_resize_object_add(win, bg);
18    evas_object_show(bg);
19
20    bx = elm_box_add(win);
21    elm_box_horizontal_set(bx, EINA_TRUE);
22    evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
23    evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
24    elm_win_resize_object_add(win, bx);
25    evas_object_show(bx);
26
27    rect = evas_object_rectangle_add(evas_object_evas_get(win));
28    evas_object_color_set(rect, 0, 255, 0, 255);
29    evas_object_size_hint_min_set(rect, 90, 200);
30    evas_object_size_hint_weight_set(rect, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
31    evas_object_size_hint_align_set(rect, EVAS_HINT_FILL, EVAS_HINT_FILL);
32    evas_object_show(rect);
33    elm_box_pack_end(bx, rect);
34
35    separator = elm_separator_add(win);
36    elm_separator_horizontal_set(separator, EINA_TRUE);
37    evas_object_show(separator);
38    elm_box_pack_end(bx, separator);
39
40    rect = evas_object_rectangle_add(evas_object_evas_get(win));
41    evas_object_color_set(rect, 0, 0, 255, 255);
42    evas_object_size_hint_min_set(rect, 90, 200);
43    evas_object_size_hint_weight_set(rect, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
44    evas_object_size_hint_align_set(rect, EVAS_HINT_FILL, EVAS_HINT_FILL);
45    evas_object_show(rect);
46    elm_box_pack_end(bx, rect);
47
48    evas_object_show(win);
49
50    elm_run();
51    elm_shutdown();
52
53    return 0;
54 }
55 ELM_MAIN()