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

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'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, (Elm_Event_Cb)\_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\-P\-I calls. To interact with the other parts of this A\-P\-I, there's a command line interface, whose help string can be asked for with the 'h' 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 'n' and 'p' keys will exemplify \hyperlink{group__Flipselector_gaf158cd6ad1b4a0171e61ab1f6e0a0dac}{elm\-\_\-flipselector\-\_\-flip\-\_\-next()} and \hyperlink{group__Flipselector_ga945b0c8f0d85d72f682707f80b61e888}{elm\-\_\-flipselector\-\_\-flip\-\_\-prev()}, respectively. 'f' and 'l' account for \hyperlink{group__Flipselector_ga353af395f37b102f9abaaedcd286fe16}{elm\-\_\-flipselector\-\_\-first\-\_\-item\-\_\-get()} and \hyperlink{group__Flipselector_ga3c64972777928481e0a4b8021f7a520f}{elm\-\_\-flipselector\-\_\-last\-\_\-item\-\_\-get()}, respectively. Finally, 's' will issue \hyperlink{group__Flipselector_ga3c3243a162a913d8b46c377a1b0b29f6}{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{DoxyImage}
\includegraphics{screenshots/flipselector_example}
\caption{width=}
\end{DoxyImage}


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