\section{panes\-\_\-example.\-c}

\begin{DoxyCodeInclude}

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

\textcolor{keyword}{static} \textcolor{keywordtype}{void}
\_press(\textcolor{keywordtype}{void} *data, Evas\_Object *obj, \textcolor{keywordtype}{void} *event\_info)
\{
   printf(\textcolor{stringliteral}{"Pressed\(\backslash\)n"});
\}

\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));
\}

\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"});
\}

\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"});
     \}
   \textcolor{keywordflow}{else}
     \{
        elm_panes_content_left_size_set(obj, size);
        printf(\textcolor{stringliteral}{"Double clicked, restoring size.\(\backslash\)n"});
     \}
   size = tmp\_size;
\}

EAPI\_MAIN \textcolor{keywordtype}{int}
elm\_main(\textcolor{keywordtype}{int} argc, \textcolor{keywordtype}{char} **argv)
\{
   Evas\_Object *win, *panes, *panes\_h, *bt;

   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

   win = elm_win_util_standard_add(\textcolor{stringliteral}{"panes"}, \textcolor{stringliteral}{"Panes Example"});
   elm_win_autodel_set(win, EINA\_TRUE);
   elm_win_focus_highlight_enabled_set(win, EINA\_TRUE);

   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);

   bt = elm_button_add(win);
   elm\_object\_text\_set(bt, \textcolor{stringliteral}{"Left"});
   evas\_object\_size\_hint\_weight\_set(bt, EVAS\_HINT\_EXPAND, EVAS\_HINT\_EXPAND);
   evas\_object\_size\_hint\_align\_set(bt, EVAS\_HINT\_FILL, EVAS\_HINT\_FILL);
   evas\_object\_show(bt);
   elm_object_part_content_set(panes, \textcolor{stringliteral}{"left"}, bt);

   panes\_h = elm_panes_add(win);
   elm_panes_horizontal_set(panes\_h, EINA\_TRUE);
   evas\_object\_size\_hint\_weight\_set(panes\_h, EVAS\_HINT\_EXPAND,
                                    EVAS\_HINT\_EXPAND);
   evas\_object\_size\_hint\_align\_set(panes\_h, EVAS\_HINT\_FILL, EVAS\_HINT\_FILL);
   evas\_object\_show(panes\_h);
   elm_object_part_content_set(panes, \textcolor{stringliteral}{"right"}, panes\_h);

   bt = elm_button_add(win);
   elm\_object\_text\_set(bt, \textcolor{stringliteral}{"Up"});
   evas\_object\_size\_hint\_weight\_set(bt, EVAS\_HINT\_EXPAND, EVAS\_HINT\_EXPAND);
   evas\_object\_size\_hint\_align\_set(bt, EVAS\_HINT\_FILL, EVAS\_HINT\_FILL);
   evas\_object\_show(bt);
   elm_object_part_content_set(panes\_h, \textcolor{stringliteral}{"left"}, bt);

   bt = elm_button_add(win);
   elm\_object\_text\_set(bt, \textcolor{stringliteral}{"Down"});
   evas\_object\_size\_hint\_weight\_set(bt, EVAS\_HINT\_EXPAND, EVAS\_HINT\_EXPAND);
   evas\_object\_size\_hint\_align\_set(bt, EVAS\_HINT\_FILL, EVAS\_HINT\_FILL);
   evas\_object\_show(bt);
   elm_object_part_content_set(panes\_h, \textcolor{stringliteral}{"right"}, bt);

   evas\_object\_smart\_callback\_add(panes, \textcolor{stringliteral}{"clicked"}, \_clicked, panes);
   evas\_object\_smart\_callback\_add(panes, \textcolor{stringliteral}{"clicked,double"}, \_clicked\_double,
                                  panes);
   evas\_object\_smart\_callback\_add(panes, \textcolor{stringliteral}{"press"}, \_press, panes);
   evas\_object\_smart\_callback\_add(panes, \textcolor{stringliteral}{"unpress"}, \_unpress, panes);

   evas\_object\_resize(win, 320, 400);
   evas\_object\_show(win);

   elm_run();
   elm_shutdown();

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