Initialize Tizen 2.3
[framework/uifw/elementary.git] / wearable / src / examples / bg_example_01.c
1 //Compile with:
2 //gcc -o bg_example_01 bg_example_01.c -g `pkg-config --cflags --libs elementary`
3
4 #include <Elementary.h>
5
6 static void
7 on_done(void *data, Evas_Object *obj, void *event_info)
8 {
9    /* quit the mainloop (elm_run) */
10    elm_exit();
11 }
12
13 EAPI_MAIN int
14 elm_main(int argc, char **argv)
15 {
16    Evas_Object *win, *bg;
17
18    win = elm_win_add(NULL, "bg-plain", ELM_WIN_BASIC);
19    elm_win_title_set(win, "Bg Plain");
20    evas_object_smart_callback_add(win, "delete,request", on_done, NULL);
21    elm_win_autodel_set(win, EINA_TRUE);
22
23    bg = elm_bg_add(win);
24    /* allow bg to expand in x & y */
25    evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
26    elm_win_resize_object_add(win, bg);
27    evas_object_show(bg);
28
29    /* and now just resize the window to a size you want. normally widgets
30     * will determine the initial size though */
31    evas_object_resize(win, 320, 320);
32    /* and show the window */
33    evas_object_show(win);
34
35    elm_run(); /* and run the program now, starting to handle all
36                * events, etc. */
37    elm_shutdown(); /* clean up and shut down */
38
39    /* exit code */
40    return 0;
41 }
42 ELM_MAIN()