efl
68 строк · 2.3 Кб
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 EINA_UNUSED, char **argv EINA_UNUSED)
16{
17Evas_Object *win, *btn, *bx, *en;
18
19elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
20
21win = elm_win_util_standard_add("conformant", "Conformant Example");
22elm_win_autodel_set(win, EINA_TRUE);
23
24bx = elm_box_add(win);
25evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
26elm_win_resize_object_add(win, bx);
27evas_object_show(bx);
28
29btn = elm_button_add(win);
30elm_object_text_set(btn, "Test Conformant");
31evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, 0);
32evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 0);
33elm_box_pack_end(bx, btn);
34evas_object_show(btn);
35
36en = elm_entry_add(win);
37elm_entry_scrollable_set(en, EINA_TRUE);
38elm_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
49evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
50evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
51evas_object_show(en);
52elm_box_pack_end(bx, en);
53
54btn = elm_button_add(win);
55elm_object_text_set(btn, "Test Conformant");
56evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, 0);
57evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 0);
58elm_box_pack_end(bx, btn);
59evas_object_show(btn);
60
61evas_object_resize(win, 240, 480);
62evas_object_show(win);
63
64elm_run();
65
66return 0;
67}
68ELM_MAIN()
69