2 //gcc -o bg_example_01 bg_example_01.c -g `pkg-config --cflags --libs elementary`
4 #include <Elementary.h>
7 on_done(void *data, Evas_Object *obj, void *event_info)
9 /* quit the mainloop (elm_run) */
14 elm_main(int argc, char **argv)
16 Evas_Object *win, *bg;
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);
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);
29 /* set size hints. a minimum size for the bg. this should propagate back
30 * to the window thus limiting its size based off the bg as the bg is one
31 * of the window's resize objects. */
32 evas_object_size_hint_min_set(bg, 160, 160);
33 /* and set a maximum size. not needed very often. normally used together
34 * with evas_object_size_hint_min_set() at the same size to make a
35 * window not resizable */
36 evas_object_size_hint_max_set(bg, 640, 640);
37 /* and now just resize the window to a size you want. normally widgets
38 * will determine the initial size though */
39 evas_object_resize(win, 320, 320);
40 /* and show the window */
41 evas_object_show(win);
43 elm_run(); /* and run the program now, starting to handle all
45 elm_shutdown(); /* clean up and shut down */