This code places an Elementary flip selector widget on a window, along with two buttons trigerring actions on it (though its A\+PI).

The selector is being populated with the following items\+:  
\begin{DoxyCodeInclude}
   \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *lbl[] =
     \{
        \textcolor{stringliteral}{"Elementary"},
        \textcolor{stringliteral}{"Evas"},
        \textcolor{stringliteral}{"Eina"},
        \textcolor{stringliteral}{"Edje"},
        \textcolor{stringliteral}{"Eet"},
        \textcolor{stringliteral}{"Ecore"},
        \textcolor{stringliteral}{"Efreet"},
        \textcolor{stringliteral}{"Eldbus"}
     \};

\end{DoxyCodeInclude}


Next, we create it, populating it with those items and registering two (smart) callbacks on it\+:  
\begin{DoxyCodeInclude}
   fp = elm_flipselector_add(win);
   evas\_object\_size\_hint\_weight\_set(fp, EVAS\_HINT\_EXPAND, EVAS\_HINT\_EXPAND);
   evas\_object\_smart\_callback\_add(fp, \textcolor{stringliteral}{"underflowed"}, \_overflow\_cb, NULL);
   evas\_object\_smart\_callback\_add(fp, \textcolor{stringliteral}{"overflowed"}, \_underflow\_cb, NULL);
   \textcolor{keywordflow}{for} (i = 0; i < \textcolor{keyword}{sizeof}(lbl) / \textcolor{keyword}{sizeof}(lbl[0]); i++)
     elm_flipselector_item_append(fp, lbl[i], NULL, NULL);
   elm_box_pack_end(bx, fp);
   evas\_object\_show(fp);

\end{DoxyCodeInclude}


Those two callbacks will take place whenever one of those smart events occur, and they will just print something to {\ttfamily stdout\+:}  
\begin{DoxyCodeInclude}
\textcolor{keywordtype}{void} \textcolor{comment}{/* underflow callback */}
\_underflow\_cb(\textcolor{keywordtype}{void}        *data,
              Evas\_Object *obj,
              \textcolor{keywordtype}{void}        *event\_info)
\{
   fprintf(stdout, \textcolor{stringliteral}{"Underflow!\(\backslash\)n"});
\}

\textcolor{keywordtype}{void} \textcolor{comment}{/* overflow callback */}
\_overflow\_cb(\textcolor{keywordtype}{void}        *data,
             Evas\_Object *obj,
             \textcolor{keywordtype}{void}        *event\_info)
\{
   fprintf(stdout, \textcolor{stringliteral}{"Overflow!\(\backslash\)n"});
\}

\end{DoxyCodeInclude}
 Flip the sheets on the widget while looking at the items list, in the source code, and you\textquotesingle{}ll get the idea of those events.

The two buttons below the flip selector will take the actions described in their labels\+:  
\begin{DoxyCodeInclude}
   bt = elm_button_add(win);
   elm\_object\_text\_set(bt, \textcolor{stringliteral}{"Unselect item"});
   evas\_object\_smart\_callback\_add(bt, \textcolor{stringliteral}{"clicked"}, \_unsel\_cb, fp);
   elm_box_pack_end(bx, bt);
   evas\_object\_show(bt);

   bt = elm_button_add(win);
   elm\_object\_text\_set(bt, \textcolor{stringliteral}{"Delete item"});
   evas\_object\_smart\_callback\_add(bt, \textcolor{stringliteral}{"clicked"}, \_del\_cb, fp);
   elm_box_pack_end(bx, bt);
   evas\_object\_show(bt);

   elm_object_event_callback_add(win, \_on\_keydown, fp);

\end{DoxyCodeInclude}


 
\begin{DoxyCodeInclude}
\textcolor{keywordtype}{void} \textcolor{comment}{/* unselect the item shown in the flip selector */}
\_unsel\_cb(\textcolor{keywordtype}{void}        *data,
          Evas\_Object *obj,
          \textcolor{keywordtype}{void}        *event\_info)
\{
   Elm_Object_Item *it;
   Evas\_Object *fp = data;

   it = elm_flipselector_selected_item_get(fp);
   elm\_flipselector\_item\_selected\_set(it, EINA\_FALSE);
\}

\textcolor{keywordtype}{void} \textcolor{comment}{/* delete the item shown in the flip selector */}
\_del\_cb(\textcolor{keywordtype}{void}        *data,
        Evas\_Object *obj,
        \textcolor{keywordtype}{void}        *event\_info)
\{
   Elm_Object_Item *it;
   Evas\_Object *fp = data;

   it = elm_flipselector_selected_item_get(fp);
   \textcolor{keywordflow}{if} (it) elm\_object\_item\_del(it);
\}

\end{DoxyCodeInclude}


Click on them to exercise those flip selector A\+PI calls. To interact with the other parts of this A\+PI, there\textquotesingle{}s a command line interface, whose help string can be asked for with the \textquotesingle{}h\textquotesingle{} key\+:  
\begin{DoxyCodeInclude}
\textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *commands = \(\backslash\)
                              \textcolor{stringliteral}{"commands are:\(\backslash\)n"}
                              \textcolor{stringliteral}{"\(\backslash\)tn - flip to next item\(\backslash\)n"}
                              \textcolor{stringliteral}{"\(\backslash\)tp - flip to previous item\(\backslash\)n"}
                              \textcolor{stringliteral}{"\(\backslash\)tf - print first item's label\(\backslash\)n"}
                              \textcolor{stringliteral}{"\(\backslash\)tl - print last item's label\(\backslash\)n"}
                              \textcolor{stringliteral}{"\(\backslash\)ts - print selected item's label\(\backslash\)n"}
                              \textcolor{stringliteral}{"\(\backslash\)th - print help\(\backslash\)n"};

\end{DoxyCodeInclude}


The \textquotesingle{}n\textquotesingle{} and \textquotesingle{}p\textquotesingle{} keys will exemplify \hyperlink{group__Elm__Flipselector_ga2973625aed5c7c100995752549266c50}{elm\+\_\+flipselector\+\_\+flip\+\_\+next()} and \hyperlink{group__Elm__Flipselector_gaf15ec628ff7ef1af149f175cfb4ba817}{elm\+\_\+flipselector\+\_\+flip\+\_\+prev()}, respectively. \textquotesingle{}f\textquotesingle{} and \textquotesingle{}l\textquotesingle{} account for \hyperlink{group__Elm__Flipselector_gab7d83fdcb543d83abb616b2a2454447f}{elm\+\_\+flipselector\+\_\+first\+\_\+item\+\_\+get()} and \hyperlink{group__Elm__Flipselector_ga85f6a5d139784e71067eec43eca847ef}{elm\+\_\+flipselector\+\_\+last\+\_\+item\+\_\+get()}, respectively. Finally, \textquotesingle{}s\textquotesingle{} will issue \hyperlink{group__Elm__Flipselector_ga53cd0c179a93a7f5cdce51deaf4e8b78}{elm\+\_\+flipselector\+\_\+selected\+\_\+item\+\_\+get()} on our example flip selector widget.

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

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


See the full \hyperlink{flipselector_example_c}{source code} for this example. 