SVN Merging for button, radio, check and toggle
[framework/uifw/elementary.git] / src / examples / frame_example_01.c
1 //Compile with:
2 //gcc -g `pkg-config --cflags --libs elementary` frame_example_01.c -o frame_example_01
3
4 #include <Elementary.h>
5 #ifdef HAVE_CONFIG_H
6 # include "elementary_config.h"
7 #endif
8
9 EAPI_MAIN int
10 elm_main(int argc, char **argv)
11 {
12    Evas_Object *win, *bg;
13    Evas_Object *f1, *r1, *f2, *r2, *f3, *r3, *f4, *r4;
14    char buf[256];
15
16    win = elm_win_add(NULL, "frame", ELM_WIN_BASIC);
17    elm_win_title_set(win, "Frame");
18    elm_win_autodel_set(win, EINA_TRUE);
19    elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
20
21    bg = elm_bg_add(win);
22    elm_win_resize_object_add(win, bg);
23    evas_object_show(bg);
24
25    r1 = evas_object_rectangle_add(evas_object_evas_get(win));
26    evas_object_color_set(r1, 255, 0, 0, 255);
27    evas_object_show(r1);
28
29    f1= elm_frame_add(win);
30    elm_object_content_set(f1, r1);
31    elm_object_text_set(f1, "Default frame");
32    evas_object_resize(f1, 100, 100);
33    evas_object_move(f1, 25, 25);
34    evas_object_show(f1);
35
36    r2 = evas_object_rectangle_add(evas_object_evas_get(win));
37    evas_object_color_set(r2, 0, 255, 0, 255);
38    evas_object_show(r2);
39
40    f2 = elm_frame_add(win);
41    elm_object_content_set(f2, r2);
42    elm_object_text_set(f2, "Padding frame");
43    evas_object_resize(f2, 100, 100);
44    evas_object_move(f2, 150, 25);
45    elm_object_style_set(f2, "pad_small");
46    evas_object_show(f2);
47
48    r3 = evas_object_rectangle_add(evas_object_evas_get(win));
49    evas_object_color_set(r3, 0, 0, 255, 255);
50    evas_object_show(r3);
51
52    f3 = elm_frame_add(win);
53    elm_object_content_set(f3, r3);
54    elm_object_text_set(f3, "Top outdent frame");
55    evas_object_resize(f3, 100, 100);
56    evas_object_move(f3, 25, 150);
57    elm_object_style_set(f3, "outdent_top");
58    evas_object_show(f3);
59
60    r4 = evas_object_rectangle_add(evas_object_evas_get(win));
61    evas_object_color_set(r4, 0, 0, 0, 255);
62    evas_object_show(r4);
63
64    f4 = elm_frame_add(win);
65    elm_object_content_set(f4, r4);
66    elm_object_text_set(f4, "Bottom outdent frame");
67    evas_object_resize(f4, 100, 100);
68    evas_object_move(f4, 150, 150);
69    elm_object_style_set(f4, "outdent_bottom");
70    evas_object_show(f4);
71
72    evas_object_resize(win, 275, 275);
73    evas_object_show(win);
74
75    elm_run();
76
77    evas_object_del(r1);
78    evas_object_del(r2);
79    evas_object_del(r3);
80    evas_object_del(r4);
81
82    return 0;
83 }
84 ELM_MAIN()