Tizen Native API
5.5
|
The full code for this example can be found at bg_example_01.c, in the function test_bg_plain
. It's part of the elementary_test
suite, and thus has the code for the three examples referenced by this documentation.
This first example just sets a default background with a plain color. The first part consists of creating an Elementary window. It's the common piece of code that you'll see everywhere in Elementary:
elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED) { Evas_Object *win; elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); win = elm_win_util_standard_add("bg-plain", "Bg Plain"); elm_win_autodel_set(win, EINA_TRUE);
Now we really create our background object, using the window object as its parent:
Then we set the size hints of the background object so that it will use all space available for it, and then add it as a resize object to the window, making it visible in the end:
See evas_object_size_hint_weight_set() and elm_win_resize_object_add() for more detailed info about these functions.
The end of the example is quite simple, just setting the minimum and maximum size of the background, so the Elementary window knows that it has to have at least the minimum size. The background also won't scale to a size above its maximum. Then we resize the window and show it in the end:
And here we finish our very simple background object usage example.