aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/elementary/src/examples/conformant_example_01.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--libraries/elementary/src/examples/conformant_example_01.c76
1 files changed, 76 insertions, 0 deletions
diff --git a/libraries/elementary/src/examples/conformant_example_01.c b/libraries/elementary/src/examples/conformant_example_01.c
new file mode 100644
index 0000000..426bea4
--- /dev/null
+++ b/libraries/elementary/src/examples/conformant_example_01.c
@@ -0,0 +1,76 @@
1/**
2 * Simple Elementary's <b>conformant widget</b> example, illustrating its
3 * usage and API.
4 *
5 * See stdout/stderr for output. Compile with:
6 *
7 * @verbatim
8 * gcc -o conformant_example_01 conformant_example_01.c -g `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, *bg, *btn, *bx, *en;
18
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);
22 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
23
24 bg = elm_bg_add(win);
25 elm_win_resize_object_add(win, bg);
26 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
27 evas_object_show(bg);
28
29 bx = elm_box_add(win);
30 elm_win_resize_object_add(win, bx);
31 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
32 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
33
34 btn = elm_button_add(win);
35 elm_object_text_set(btn, "Test Conformant");
36 evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, 0);
37 evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 0);
38 elm_box_pack_end(bx, btn);
39 evas_object_show(btn);
40
41 en = elm_entry_add(win);
42 elm_entry_scrollable_set(en, EINA_TRUE);
43 elm_object_text_set(en,
44 "This is a multi-line entry at the bottom<br>"
45 "This can contain more than 1 line of text and be "
46 "scrolled around to allow for entering of lots of "
47 "content. It is also to test to see that autoscroll "
48 "moves to the right part of a larger multi-line "
49 "text entry that is inside of a scroller than can be "
50 "scrolled around, thus changing the expected position "
51 "as well as cursor changes updating auto-scroll when "
52 "it is enabled.");
53
54 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
55 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
56 evas_object_show(en);
57 elm_box_pack_end(bx, en);
58
59 btn = elm_button_add(win);
60 elm_object_text_set(btn, "Test Conformant");
61 evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, 0);
62 evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 0);
63 elm_box_pack_end(bx, btn);
64 evas_object_show(btn);
65
66 evas_object_show(bx);
67
68 evas_object_resize(win, 240, 480);
69 evas_object_show(win);
70
71 elm_run();
72 elm_shutdown();
73
74 return 0;
75}
76ELM_MAIN()