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