

The full code for this example can be found at \mbox{\hyperlink{bg_example_01_c}{bg\+\_\+example\+\_\+01.\+c}}, in the function {\ttfamily test\+\_\+bg\+\_\+plain}. It\textquotesingle{}s part of the {\ttfamily 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\textquotesingle{}s the common piece of code that you\textquotesingle{}ll see everywhere in Elementary\+: 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{elm\_main(\textcolor{keywordtype}{int}\ argc\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},\ \textcolor{keywordtype}{char}\ **argv\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}}\ *win;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_ga7a05f37fd3a019da5e26c5fc91fcd937}{elm\_policy\_set}}(\mbox{\hyperlink{group__Elm__General_ggaa16f3378ecdbf660fa378402e3c5a0a9a02fadb6faada04b19d0fa42c11a8d32a}{ELM\_POLICY\_QUIT}},\ \mbox{\hyperlink{group__Elm__General_gga46af37e6ac2c406321060be827117196abbe0962d88ae12afe1a173da881f56cd}{ELM\_POLICY\_QUIT\_LAST\_WINDOW\_CLOSED}});}
\DoxyCodeLine{\ \ \ win\ =\ \mbox{\hyperlink{group__Elm__Win__Group_ga23d9d1ffa0a65a1a1dd482d570db1ba0}{elm\_win\_util\_standard\_add}}(\textcolor{stringliteral}{"{}bg-\/plain"{}},\ \textcolor{stringliteral}{"{}Bg\ Plain"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Win__Group_ga9a16a2f8c9fd5b6e9203ed9dcb53ea8b}{elm\_win\_autodel\_set}}(win,\ \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}

\end{DoxyCodeInclude}
 Now we really create our background object, using the window object as its parent\+:


\begin{DoxyCodeInclude}{0}

\end{DoxyCodeInclude}
 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\+:


\begin{DoxyCodeInclude}{0}

\end{DoxyCodeInclude}
 See \mbox{\hyperlink{group__Evas__Object__Group_ga9379629ad8ad2860aa786d838a4a106a}{evas\+\_\+object\+\_\+size\+\_\+hint\+\_\+weight\+\_\+set()}} and \mbox{\hyperlink{group__Elm__Win__Group_ga505d6bd217e5ee01e82b548ec35986eb}{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\textquotesingle{}t scale to a size above its maximum. Then we resize the window and show it in the end\+:


\begin{DoxyCodeInclude}{0}

\end{DoxyCodeInclude}
 And here we finish our very simple background object usage example. 