summaryrefslogtreecommitdiff
path: root/src/examples/elementary/efl_ui_relative_container_example_02.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/examples/elementary/efl_ui_relative_container_example_02.c')
-rw-r--r--src/examples/elementary/efl_ui_relative_container_example_02.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/examples/elementary/efl_ui_relative_container_example_02.c b/src/examples/elementary/efl_ui_relative_container_example_02.c
new file mode 100644
index 0000000..bb18c26
--- /dev/null
+++ b/src/examples/elementary/efl_ui_relative_container_example_02.c
@@ -0,0 +1,44 @@
1// gcc -o efl_ui_relative_container_example_02 efl_ui_relative_container_example_02.c `pkg-config --cflags --libs elementary`
2
3#ifdef HAVE_CONFIG_H
4#include "elementary_config.h"
5#else
6#define EFL_BETA_API_SUPPORT 1
7#endif
8
9#include <Efl_Ui.h>
10#include <Elementary.h>
11#include <Efl.h>
12
13EAPI_MAIN int
14elm_main(int argc, char **argv)
15{
16 Eo *win, *layout, *btn1, *btn2;
17
18 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
19 efl_text_set(efl_added, "Efl.Ui.Relative_Container"),
20 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
21
22 layout = efl_add(EFL_UI_RELATIVE_CONTAINER_CLASS, win,
23 efl_content_set(win, efl_added));
24
25 btn1 = efl_add(EFL_UI_BUTTON_CLASS, layout,
26 efl_text_set(efl_added, "btn1"),
27 efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(100, 100)));
28
29 btn2 = efl_add(EFL_UI_BUTTON_CLASS, layout,
30 efl_text_set(efl_added, "btn2"),
31 efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(0, 100)));
32
33 efl_ui_relative_container_relation_right_set(layout, btn1, btn2, 0.0);
34 efl_ui_relative_container_relation_bottom_set(layout, btn1, btn2, 0.0);
35
36 efl_ui_relative_container_relation_left_set(layout, btn2, btn1, 1.0);
37 efl_ui_relative_container_relation_top_set(layout, btn2, btn1, 1.0);
38
39 efl_gfx_entity_size_set(win, EINA_SIZE2D(300, 300));
40
41 elm_run();
42 return 0;
43}
44ELM_MAIN()