This code places 4 Elementary diskselector widgets on a window, each of them exemplifying a part of the widget\textquotesingle{}s A\+P\+I.

All of them will have weekdays as items, since we won\textquotesingle{}t focus on items management on this example. For an example about this subject, check \hyperlink{diskselector_example_02}{Diskselector -\/ Items management}.

The first of them is a default diskselector.  
\begin{DoxyCodeInclude}
   \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *lbl[] =
     \{
        \textcolor{stringliteral}{"Sunday"},
        \textcolor{stringliteral}{"Monday"},
        \textcolor{stringliteral}{"Tuesday"},
        \textcolor{stringliteral}{"Wednesday"},
        \textcolor{stringliteral}{"Thursday"},
        \textcolor{stringliteral}{"Friday"},
        \textcolor{stringliteral}{"Saturday"}
     \};
   ds = elm_diskselector_add(win);
   evas\_object\_size\_hint\_weight\_set(ds, EVAS\_HINT\_EXPAND, EVAS\_HINT\_EXPAND);
   evas\_object\_size\_hint\_align\_set(ds, EVAS\_HINT\_FILL, EVAS\_HINT\_FILL);
   elm_box_pack_end(bx, ds);
   \textcolor{keywordflow}{for} (i = 0; i < \textcolor{keyword}{sizeof}(lbl) / \textcolor{keyword}{sizeof}(lbl[0]); i++)
     elm_diskselector_item_append(ds, lbl[i], NULL, NULL, NULL);
   evas\_object\_show(ds);

\end{DoxyCodeInclude}


We are just adding the diskselector, so as you can see, defaults for it are\+: \begin{DoxyItemize}
\item Only 3 items visible each time. \item Only 3 characters are displayed for labels on side positions. \item The first added item remains centeres, i.\+e., it\textquotesingle{}s the selected item.\end{DoxyItemize}
To add items, we are just appending it on a loop, using function \hyperlink{group__Diskselector_gad1935ecbe12b1a7d9998275534fbe4d7}{elm\+\_\+diskselector\+\_\+item\+\_\+append()}, that will be better explained on items management example.

For a circular diskselector, check the second widget. A circular diskselector will display first item after last, and last previous to the first one. So, as you can see, {\bfseries Sa} will appears on left side of selected {\bfseries Sunday}. This property is set with \hyperlink{group__Diskselector_ga30caf1f47ef6bafd61dcc17a47b21a78}{elm\+\_\+diskselector\+\_\+round\+\_\+enabled\+\_\+set()}.

Also, we decide to display only 2 character for side labels, instead of 3. For this we call \hyperlink{group__Diskselector_gaa9f2aea2aa5dc9b9783cd97d5585131e}{elm\+\_\+diskselector\+\_\+side\+\_\+text\+\_\+max\+\_\+length\+\_\+set()}. As result, we\textquotesingle{}ll see {\bfseries Mo} displayed instead of {\bfseries Mon}, when {\bfseries Monday} is on a side position.


\begin{DoxyCodeInclude}
   ds = elm_diskselector_add(win);
   evas\_object\_size\_hint\_weight\_set(ds, EVAS\_HINT\_EXPAND, EVAS\_HINT\_EXPAND);
   evas\_object\_size\_hint\_align\_set(ds, EVAS\_HINT\_FILL, EVAS\_HINT\_FILL);
   elm_box_pack_end(bx, ds);
   \textcolor{keywordflow}{for} (i = 0; i < \textcolor{keyword}{sizeof}(lbl) / \textcolor{keyword}{sizeof}(lbl[0]); i++)
     elm_diskselector_item_append(ds, lbl[i], NULL, NULL, NULL);
   elm_diskselector_round_enabled_set(ds, EINA\_TRUE);
   elm_diskselector_side_text_max_length_set(ds, 2);
   evas\_object\_show(ds);

\end{DoxyCodeInclude}


But so far, we are only displaying 3 items at once. If more are wanted, is enough to call \hyperlink{group__Diskselector_ga422a509910213cb9fa6121349d5d077c}{elm\+\_\+diskselector\+\_\+display\+\_\+item\+\_\+num\+\_\+set()}, as you can see here\+: 
\begin{DoxyCodeInclude}
   ds = elm_diskselector_add(win);
   evas\_object\_size\_hint\_weight\_set(ds, EVAS\_HINT\_EXPAND, EVAS\_HINT\_EXPAND);
   evas\_object\_size\_hint\_align\_set(ds, EVAS\_HINT\_FILL, EVAS\_HINT\_FILL);
   elm_box_pack_end(bx, ds);
   \textcolor{keywordflow}{for} (i = 0; i < \textcolor{keyword}{sizeof}(lbl) / \textcolor{keyword}{sizeof}(lbl[0]); i++)
     elm_diskselector_item_append(ds, lbl[i], NULL, NULL, NULL);
   elm_diskselector_display_item_num_set(ds, 5);

\end{DoxyCodeInclude}


\begin{DoxyNote}{Note}
You can\textquotesingle{}t set less than 3 items to be displayed.
\end{DoxyNote}
You can get the number of items in the diskselector by calling \hyperlink{group__Diskselector_ga3e477ad7782102908f776e2171a17ea7}{elm\+\_\+diskselector\+\_\+display\+\_\+item\+\_\+num\+\_\+get()}, as you can see here\+: 
\begin{DoxyCodeInclude}
   printf(\textcolor{stringliteral}{"Number of Items in DiskSelector : %d\(\backslash\)n"}, 
      elm_diskselector_display_item_num_get(ds));

\end{DoxyCodeInclude}


Finally, if a bounce effect is required, or you would like to see scrollbars, it is possible. But, for default theme, diskselector scrollbars will be invisible anyway. 
\begin{DoxyCodeInclude}
   ds = elm_diskselector_add(win);
   evas\_object\_size\_hint\_weight\_set(ds, EVAS\_HINT\_EXPAND, EVAS\_HINT\_EXPAND);
   evas\_object\_size\_hint\_align\_set(ds, EVAS\_HINT\_FILL, EVAS\_HINT\_FILL);
   elm_box_pack_end(bx, ds);
   \textcolor{keywordflow}{for} (i = 0; i < \textcolor{keyword}{sizeof}(lbl) / \textcolor{keyword}{sizeof}(lbl[0]); i++)
     elm_diskselector_item_append(ds, lbl[i], NULL, NULL, NULL);
   elm_scroller_bounce_set(ds, EINA\_TRUE, EINA\_TRUE);
   elm_scroller_policy_set(ds, ELM_SCROLLER_POLICY_AUTO,
                           ELM_SCROLLER_POLICY_ON);
   evas\_object\_show(ds);

\end{DoxyCodeInclude}


See the full \hyperlink{diskselector_example_01_8c-example}{diskselector\+\_\+example\+\_\+01.c} code, whose window should look like this picture\+:

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