This code places two Elementary panes widgets on a window, one of them displayed vertically and the other horizontally, to exemplify a part of the widget's A\-P\-I.

Also, all the signals emitted by this widget will be covered.

Let's start adding a panes to our window\-:  
\begin{DoxyCodeInclude}
   panes = elm_panes_add(win);
   evas\_object\_size\_hint\_weight\_set(panes, EVAS\_HINT\_EXPAND, EVAS\_HINT\_EXPAND);
   elm_win_resize_object_add(win, panes);
   evas\_object\_show(panes);

\end{DoxyCodeInclude}


Now we will set a content (a simple button) to the left side of our panes widget\-: 
\begin{DoxyCodeInclude}
   bt = elm_button_add(win);

\end{DoxyCodeInclude}


The content of the right side will be something a bit more elaborated, we'll place another panes, displayed vertically (it's displayed horizontally by default)\-: 
\begin{DoxyCodeInclude}

\end{DoxyCodeInclude}


When populating a panes displayed vertically, remember that left content will be placed at top, and right content will place at bottom. Next we will add two buttons to exemplify that\-: 
\begin{DoxyCodeInclude}

\end{DoxyCodeInclude}


Panes widgets emits 4 different signals, depending on users interaction with the draggable bar. We'll add a callback function for each of them.

{\ttfamily  \char`\"{}clicked\char`\"{} signal }\-:

Callback function that just print \char`\"{}\-Clicked\char`\"{} to stdin\-:  
\begin{DoxyCodeInclude}
\textcolor{keyword}{static} \textcolor{keywordtype}{void}
\_clicked\_double(\textcolor{keywordtype}{void} *data, Evas\_Object *obj, \textcolor{keywordtype}{void} *event\_info)
\{
   \textcolor{keyword}{static} \textcolor{keywordtype}{double} size = 0.0;
   \textcolor{keywordtype}{double} tmp\_size = 0.0;

   tmp\_size = elm_panes_content_left_size_get(obj);
   \textcolor{keywordflow}{if} (tmp\_size > 0)
     \{
        elm_panes_content_left_size_set(obj, 0.0);
        printf(\textcolor{stringliteral}{"Double clicked, hidding.\(\backslash\)n"});
     \}

\end{DoxyCodeInclude}


Also, add callback function to the panes\-: 
\begin{DoxyCodeInclude}
   evas\_object\_smart\_callback\_add(panes, \textcolor{stringliteral}{"clicked"}, \_clicked, panes);

\end{DoxyCodeInclude}


{\ttfamily  \char`\"{}press\char`\"{} signal }\-:

Callback function that just print \char`\"{}\-Pressed\char`\"{} to stdin\-:  
\begin{DoxyCodeInclude}
\textcolor{keyword}{static} \textcolor{keywordtype}{void}
\_unpress(\textcolor{keywordtype}{void} *data, Evas\_Object *obj, \textcolor{keywordtype}{void} *event\_info)
\{
   printf(\textcolor{stringliteral}{"Unpressed, size : %f\(\backslash\)n"}, elm_panes_content_left_size_get(obj));
\}

\end{DoxyCodeInclude}


Also, add callback function to the panes\-: 
\begin{DoxyCodeInclude}
   evas\_object\_smart\_callback\_add(panes, \textcolor{stringliteral}{"press"}, \_press, panes);

\end{DoxyCodeInclude}


Now, let's try to make our callback functions a bit more useful\-:

{\ttfamily  \char`\"{}unpress\char`\"{} signal }\-:

Suppose we want to know the size proportion of left content after user drags the bar. We need to listen for {\ttfamily unpress} signal, and get this size from our panes widget. It's done on the following function\-:  
\begin{DoxyCodeInclude}
\textcolor{keyword}{static} \textcolor{keywordtype}{void}
\_clicked(\textcolor{keywordtype}{void} *data, Evas\_Object *obj, \textcolor{keywordtype}{void} *event\_info)
\{
   printf(\textcolor{stringliteral}{"Clicked\(\backslash\)n"});
\}

\end{DoxyCodeInclude}


Adding the callback function to the panes\-: 
\begin{DoxyCodeInclude}
   evas\_object\_smart\_callback\_add(panes, \textcolor{stringliteral}{"unpress"}, \_unpress, panes);

\end{DoxyCodeInclude}


{\ttfamily  \char`\"{}clicked,double\char`\"{} signal }\-:

Now, a interesting feature that could be addded to panes widget. Hide a content when user double click the draggable bar. It's done using a variable to store size and content left size getter and setter on the following function\-:  
\begin{DoxyCodeInclude}
   \textcolor{keyword}{static} \textcolor{keywordtype}{double} size = 0.0;

\end{DoxyCodeInclude}


Adding the callback function to the panes\-: 
\begin{DoxyCodeInclude}

\end{DoxyCodeInclude}


See the full \hyperlink{panes_example_8c-example}{example}, whose window should look like this picture\-:

 
\begin{DoxyImage}
\includegraphics{screenshots/panes_example}
\caption{width=}
\end{DoxyImage}
 