2 * Simple Elementary's <b>conformant widget</b> example, illustrating its
5 * See stdout/stderr for output. Compile with:
8 * gcc -g conformant_example_02.c -o conformant_example_02 `pkg-config --cflags --libs elementary`
12 #include <Elementary.h>
15 elm_main(int argc, char **argv)
17 Evas_Object *win, *bg, *conform, *btn, *bx, *en;
19 win = elm_win_add(NULL, "conformant", ELM_WIN_BASIC);
20 elm_win_title_set(win, "Conformant Example");
21 elm_win_autodel_set(win, EINA_TRUE);
23 elm_win_conformant_set(win, EINA_TRUE);
26 elm_win_resize_object_add(win, bg);
27 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
30 conform = elm_conformant_add(win);
31 elm_win_resize_object_add(win, conform);
32 evas_object_size_hint_weight_set(conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
33 evas_object_show(conform);
35 bx = elm_box_add(win);
36 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
37 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
39 btn = elm_button_add(win);
40 elm_object_text_set(btn, "Test Conformant");
41 evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, 0);
42 evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 0);
43 elm_box_pack_end(bx, btn);
44 evas_object_show(btn);
46 en = elm_entry_add(win);
47 elm_entry_scrollable_set(en, EINA_TRUE);
48 elm_object_text_set(en,
49 "This is a multi-line entry at the bottom<br>"
50 "This can contain more than 1 line of text and be "
51 "scrolled around to allow for entering of lots of "
52 "content. It is also to test to see that autoscroll "
53 "moves to the right part of a larger multi-line "
54 "text entry that is inside of a scroller than can be "
55 "scrolled around, thus changing the expected position "
56 "as well as cursor changes updating auto-scroll when "
59 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
60 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
62 elm_box_pack_end(bx, en);
64 btn = elm_button_add(win);
65 elm_object_text_set(btn, "Test Conformant");
66 evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, 0);
67 evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 0);
68 elm_box_pack_end(bx, btn);
69 evas_object_show(btn);
71 elm_object_content_set(conform, bx);
74 evas_object_resize(win, 240, 480);
75 evas_object_show(win);