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