efl

Форк
0
/
conformant_example_01.c 
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

14
EAPI_MAIN int
15
elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
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
}
68
ELM_MAIN()
69

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.