diff options
Diffstat (limited to '')
-rw-r--r-- | libraries/elementary/src/examples/table_example_01.c | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/libraries/elementary/src/examples/table_example_01.c b/libraries/elementary/src/examples/table_example_01.c new file mode 100644 index 0000000..16d6036 --- /dev/null +++ b/libraries/elementary/src/examples/table_example_01.c | |||
@@ -0,0 +1,53 @@ | |||
1 | //Compile with: | ||
2 | //gcc -g table_example_01.c -o table_example_01 `pkg-config --cflags --libs elementary` | ||
3 | |||
4 | #include <Elementary.h> | ||
5 | |||
6 | EAPI_MAIN int | ||
7 | elm_main(int argc, char **argv) | ||
8 | { | ||
9 | Evas_Object *win, *bg, *label, *table; | ||
10 | |||
11 | win = elm_win_add(NULL, "table", ELM_WIN_BASIC); | ||
12 | elm_win_title_set(win, "Table"); | ||
13 | elm_win_autodel_set(win, EINA_TRUE); | ||
14 | elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); | ||
15 | |||
16 | bg = elm_bg_add(win); | ||
17 | elm_win_resize_object_add(win, bg); | ||
18 | evas_object_show(bg); | ||
19 | |||
20 | table = elm_table_add(win); | ||
21 | elm_win_resize_object_add(win, table); | ||
22 | evas_object_show(table); | ||
23 | elm_table_padding_set(table, 5, 5); | ||
24 | elm_table_homogeneous_set(table, EINA_TRUE); | ||
25 | |||
26 | label = elm_label_add(win); | ||
27 | elm_object_text_set(label, "label 0"); | ||
28 | evas_object_show(label); | ||
29 | elm_table_pack(table, label, 0, 0, 1, 1); | ||
30 | |||
31 | label = elm_label_add(win); | ||
32 | elm_object_text_set(label, "label 1"); | ||
33 | evas_object_show(label); | ||
34 | elm_table_pack(table, label, 1, 0, 1, 1); | ||
35 | |||
36 | label = elm_label_add(win); | ||
37 | elm_object_text_set(label, "label 2"); | ||
38 | evas_object_show(label); | ||
39 | elm_table_pack(table, label, 0, 1, 1, 1); | ||
40 | |||
41 | label = elm_label_add(win); | ||
42 | elm_object_text_set(label, "label 3"); | ||
43 | evas_object_show(label); | ||
44 | elm_table_pack(table, label, 1, 1, 1, 1); | ||
45 | |||
46 | evas_object_show(win); | ||
47 | |||
48 | elm_run(); | ||
49 | elm_shutdown(); | ||
50 | |||
51 | return 0; | ||
52 | } | ||
53 | ELM_MAIN() | ||