

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'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\-O\-P 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\-H\-T 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't set the orientation(which means it will use the default\-: L\-E\-F\-T)\-: 
\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();
   elm_shutdown();

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

\end{DoxyCodeInclude}


This example will look like this;

 
\begin{DoxyImage}
\includegraphics{screenshots/panel_example_01}
\caption{width=}
\end{DoxyImage}
 \begin{DoxyNote}{Note}
The buttons with arrow allow the user to hide/show the panels. 
\end{DoxyNote}
