summaryrefslogtreecommitdiff
path: root/src/examples/table_cxx_example_02.cc
blob: 9ab119c07736151928e0fbf505165e5687405035 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <Elementary.hh>
#include <Evas.hh>

EAPI_MAIN int
elm_main (int argc, char *argv[])
{
   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN);

   ::elm::win win(elm_win_util_standard_add("table", "Table"));
   win.autohide_set(true);

   ::elm::table table(efl::eo::parent = win);
   win.resize_object_add(table);
   table.visible_set(true);
   table.homogeneous_set(false);

   evas::rectangle rect(efl::eo::parent = win);
   rect.color_set( 255, 0, 0, 255);
   rect.size_hint_min_set( 100, 50);
   rect.visible_set(true);
   table.pack(rect, 0, 0, 2, 1);

   evas::rectangle rect2(efl::eo::parent = win);
   rect2.color_set( 0, 255, 0, 255);
   rect2.size_hint_min_set(50, 100);
   rect2.visible_set(true);
   table.pack(rect2, 0, 1, 1, 2);

   evas::rectangle rect3(efl::eo::parent = win);
   rect3.color_set( 0, 0, 255, 255);
   rect3.size_hint_min_set(50, 50);
   rect3.visible_set(true);
   table.pack(rect3, 1, 1, 1, 1);

   evas::rectangle rect4(efl::eo::parent = win);
   rect4.color_set( 255, 255, 0, 255);
   rect4.size_hint_min_set(50, 50);
   rect4.visible_set(true);
   table.pack(rect4, 1, 2, 1, 1);

   win.visible_set(true);

   elm_run();
   return 0;
}
ELM_MAIN()