

In this example we are going to pack two rectangles in a box, and have a separator in the middle.

So we start we the window, background, box and rectangle creation, all pretty normal stuff\+: 
\begin{DoxyCodeInclude}
\textcolor{comment}{//Compile with:}
\textcolor{comment}{//gcc -g separator\_example\_01.c -o separator\_example\_01 `pkg-config --cflags --libs elementary`}

\textcolor{preprocessor}{#include <Elementary.h>}

EAPI\_MAIN \textcolor{keywordtype}{int}
elm\_main(\textcolor{keywordtype}{int} argc, \textcolor{keywordtype}{char} **argv)
\{
   Evas\_Object *win, *bx, *rect, *separator;

   elm_policy_set(ELM\_POLICY\_QUIT, ELM\_POLICY\_QUIT\_LAST\_WINDOW\_CLOSED);

   win = elm_win_util_standard_add(\textcolor{stringliteral}{"separator"}, \textcolor{stringliteral}{"Separator"});
   elm\_win\_autodel\_set(win, EINA\_TRUE);

   bx = elm_box_add(win);
   elm\_box\_horizontal\_set(bx, EINA\_TRUE);
   evas\_object\_size\_hint\_weight\_set(bx, EVAS\_HINT\_EXPAND, EVAS\_HINT\_EXPAND);
   elm\_win\_resize\_object\_add(win, bx);
   evas\_object\_show(bx);

   rect = evas\_object\_rectangle\_add(evas\_object\_evas\_get(win));
   evas\_object\_color\_set(rect, 0, 255, 0, 255);
   evas\_object\_size\_hint\_min\_set(rect, 90, 200);
   evas\_object\_size\_hint\_weight\_set(rect, EVAS\_HINT\_EXPAND, EVAS\_HINT\_EXPAND);
   evas\_object\_size\_hint\_align\_set(rect, EVAS\_HINT\_FILL, EVAS\_HINT\_FILL);
   evas\_object\_show(rect);
   elm\_box\_pack\_end(bx, rect);

\end{DoxyCodeInclude}


Once we have our first rectangle in the box we create and add our separator\+: 
\begin{DoxyCodeInclude}

   separator = elm_separator_add(win);
   elm\_separator\_horizontal\_set(separator, EINA\_TRUE);
   evas\_object\_show(separator);
   elm\_box\_pack\_end(bx, separator);

\end{DoxyCodeInclude}
 \begin{DoxyNote}{Note}
Since our box is in horizontal mode it\textquotesingle{}s a good idea to set the separator to be horizontal too.
\end{DoxyNote}
And now we add our second rectangle and run the main loop\+: 
\begin{DoxyCodeInclude}

   rect = evas\_object\_rectangle\_add(evas\_object\_evas\_get(win));
   evas\_object\_color\_set(rect, 0, 0, 255, 255);
   evas\_object\_size\_hint\_min\_set(rect, 90, 200);
   evas\_object\_size\_hint\_weight\_set(rect, EVAS\_HINT\_EXPAND, EVAS\_HINT\_EXPAND);
   evas\_object\_size\_hint\_align\_set(rect, EVAS\_HINT\_FILL, EVAS\_HINT\_FILL);
   evas\_object\_show(rect);
   elm\_box\_pack\_end(bx, rect);

   evas\_object\_show(win);

   elm_run();

   \textcolor{keywordflow}{return} 0;
\}
ELM_MAIN()

\end{DoxyCodeInclude}


This example will look like this\+:

 
\begin{DoxyImageNoCaption}
  \mbox{\includegraphics[width=\textwidth]{screenshots/separator_example_01}}
\end{DoxyImageNoCaption}
 