cxx: Added examples and tutorial for C++ binding
[platform/upstream/elementary.git] / src / examples / table_cxx_example_01.cc
1 #include <Elementary.hh>
2
3 EAPI_MAIN int
4 elm_main (int argc, char *argv[])
5 {
6    elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN);
7
8    ::elm::win win(elm_win_util_standard_add("table", "Table"));
9    win.autohide_set(true);
10
11    ::elm::table table(efl::eo::parent = win);
12    win.resize_object_add(table);
13    table.visible_set(true);
14    table.padding_set(5, 5);
15    table.homogeneous_set(true);
16
17    ::elm::label label(efl::eo::parent = win);
18    label.text_set(nullptr, "label 0");
19    label.visible_set(true);
20    table.pack(label, 0, 0, 1, 1);
21
22    ::elm::label label1(efl::eo::parent = win);
23    label1.text_set(nullptr, "label 1");
24    label1.visible_set(true);
25    table.pack(label1, 1, 0, 1, 1);
26
27    ::elm::label label2(efl::eo::parent = win);
28    label2.text_set(nullptr, "label 2");
29    label2.visible_set(true);
30    table.pack(label2, 0, 1, 1, 1);
31
32    ::elm::label label3(efl::eo::parent = win);
33    label3.text_set(nullptr, "label 3");
34    label3.visible_set(true);
35    table.pack(label3, 1, 1, 1, 1);
36
37    win.visible_set(true);
38
39    elm_run();
40    return 0;
41 }
42 ELM_MAIN()
43