summaryrefslogtreecommitdiff
path: root/src/examples/elementary/conformant_example_01.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/conformant_example_01.c
parent9340855597e7e465435c69b6278650346688da14 (diff)
elementary: move all legacy files to their expected new location.
Diffstat (limited to 'src/examples/elementary/conformant_example_01.c')
-rw-r--r--src/examples/elementary/conformant_example_01.c68
1 files changed, 68 insertions, 0 deletions
diff --git a/src/examples/elementary/conformant_example_01.c b/src/examples/elementary/conformant_example_01.c
new file mode 100644
index 0000000000..d1b1fd5115
--- /dev/null
+++ b/src/examples/elementary/conformant_example_01.c
@@ -0,0 +1,68 @@
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, *btn, *bx, *en;
18
19 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
20
21 win = elm_win_util_standard_add("conformant", "Conformant Example");
22 elm_win_autodel_set(win, EINA_TRUE);
23
24 bx = elm_box_add(win);
25 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
26 elm_win_resize_object_add(win, bx);
27 evas_object_show(bx);
28
29 btn = elm_button_add(win);
30 elm_object_text_set(btn, "Test Conformant");
31 evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, 0);
32 evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 0);
33 elm_box_pack_end(bx, btn);
34 evas_object_show(btn);
35
36 en = elm_entry_add(win);
37 elm_entry_scrollable_set(en, EINA_TRUE);
38 elm_object_text_set(en,
39 "This is a multi-line entry at the bottom<br>"
40 "This can contain more than 1 line of text and be "
41 "scrolled around to allow for entering of lots of "
42 "content. It is also to test to see that autoscroll "
43 "moves to the right part of a larger multi-line "
44 "text entry that is inside of a scroller than can be "
45 "scrolled around, thus changing the expected position "
46 "as well as cursor changes updating auto-scroll when "
47 "it is enabled.");
48
49 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
50 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
51 evas_object_show(en);
52 elm_box_pack_end(bx, en);
53
54 btn = elm_button_add(win);
55 elm_object_text_set(btn, "Test Conformant");
56 evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, 0);
57 evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 0);
58 elm_box_pack_end(bx, btn);
59 evas_object_show(btn);
60
61 evas_object_resize(win, 240, 480);
62 evas_object_show(win);
63
64 elm_run();
65
66 return 0;
67}
68ELM_MAIN()