

In this example will have 3 panels, one for each possible orientation. Two of our panels will start out hidden, the third will start out expanded. For each of the panels we will use a label as the content, it\textquotesingle{}s however possible to have any widget(including containers) as the content of panels.

We start by doing some setup, code you should be familiar with from other examples\+: 
\begin{DoxyCodeInclude}
\textcolor{comment}{//Compile with:}
\textcolor{comment}{//gcc -g panel\_example\_01.c -o panel\_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, *panel, *content;

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

   win = elm_win_util_standard_add(\textcolor{stringliteral}{"panel"}, \textcolor{stringliteral}{"Panel"});
   elm_win_autodel_set(win, EINA\_TRUE);

   bx = elm_box_add(win);
   elm_box_horizontal_set(bx, EINA\_FALSE);
   evas\_object\_size\_hint\_weight\_set(bx, EVAS\_HINT\_EXPAND, EVAS\_HINT\_EXPAND);
   elm_win_resize_object_add(win, bx);
   evas\_object\_show(bx);

\end{DoxyCodeInclude}


And move right to creating our first panel, for this panel we are going to choose the orientation as T\+OP and toggle it(tell it to hide itself)\+: 
\begin{DoxyCodeInclude}

   panel = elm_panel_add(win);
   elm_panel_orient_set(panel, ELM\_PANEL\_ORIENT\_TOP);
   elm_panel_toggle(panel);
   evas\_object\_size\_hint\_weight\_set(panel, EVAS\_HINT\_EXPAND, EVAS\_HINT\_EXPAND);
   evas\_object\_size\_hint\_align\_set(panel, EVAS\_HINT\_FILL, EVAS\_HINT\_FILL);
   evas\_object\_show(panel);
   elm_box_pack_end(bx, panel);

\end{DoxyCodeInclude}


For the second panel we choose the R\+I\+G\+HT orientation and explicitly set the state as hidden\+: 
\begin{DoxyCodeInclude}

   content = elm_label_add(win);
   elm\_object\_text\_set(content, \textcolor{stringliteral}{"content"});
   evas\_object\_show(content);
   elm\_object\_content\_set(panel, content);

   panel = elm_panel_add(win);
   elm_panel_orient_set(panel, ELM_PANEL_ORIENT_RIGHT);
   elm_panel_hidden_set(panel, EINA\_TRUE);
   evas\_object\_size\_hint\_weight\_set(panel, EVAS\_HINT\_EXPAND, EVAS\_HINT\_EXPAND);
   evas\_object\_size\_hint\_align\_set(panel, EVAS\_HINT\_FILL, EVAS\_HINT\_FILL);
   evas\_object\_show(panel);
   elm_box_pack_end(bx, panel);

\end{DoxyCodeInclude}


For our third and last panel we won\textquotesingle{}t set the orientation(which means it will use the default\+: L\+E\+FT)\+: 
\begin{DoxyCodeInclude}

   content = elm_label_add(win);
   elm\_object\_text\_set(content, \textcolor{stringliteral}{"content2"});
   evas\_object\_show(content);
   elm\_object\_content\_set(panel, content);

   panel = elm_panel_add(win);
   evas\_object\_size\_hint\_weight\_set(panel, EVAS\_HINT\_EXPAND, EVAS\_HINT\_EXPAND);
   evas\_object\_size\_hint\_align\_set(panel, EVAS\_HINT\_FILL, EVAS\_HINT\_FILL);
   evas\_object\_show(panel);
   elm_box_pack_end(bx, panel);

\end{DoxyCodeInclude}


All that is left is running the main loop\+: 
\begin{DoxyCodeInclude}

   content = elm_label_add(win);
   elm\_object\_text\_set(content, \textcolor{stringliteral}{"content2"});
   evas\_object\_show(content);
   elm\_object\_content\_set(panel, content);

   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/panel_example_01}}
\end{DoxyImageNoCaption}
 \begin{DoxyNote}{Note}
The buttons with arrow allow the user to hide/show the panels. 
\end{DoxyNote}
