\section{diskselector\+\_\+example\+\_\+01.\+c}

\begin{DoxyCodeInclude}

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

EAPI\_MAIN \textcolor{keywordtype}{int}
elm\_main(\textcolor{keywordtype}{int} argc, \textcolor{keywordtype}{char} **argv)
\{
   Evas\_Object *win, *bx, *ds;
   \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} i;
   \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"}
     \};

   elm_policy_set(ELM\_POLICY\_QUIT, ELM\_POLICY\_QUIT\_LAST\_WINDOW\_CLOSED);

   win = elm_win_util_standard_add(\textcolor{stringliteral}{"diskselector"}, \textcolor{stringliteral}{"Diskselector Example"});
   elm_win_autodel_set(win, EINA\_TRUE);

   bx = elm_box_add(win);
   evas\_object\_size\_hint\_weight\_set(bx, EVAS\_HINT\_EXPAND, EVAS\_HINT\_EXPAND);
   elm_win_resize_object_add(win, bx);
   evas\_object\_show(bx);

   \textcolor{comment}{/* default */}
   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);

   \textcolor{comment}{/* set round mode and define side label length */}
   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);

   \textcolor{comment}{/* display more than 3 items */}
   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);
   printf(\textcolor{stringliteral}{"Number of Items in DiskSelector : %d\(\backslash\)n"}, 
      elm_diskselector_display_item_num_get(ds));
   evas\_object\_show(ds);

   \textcolor{comment}{/* set bounce and scroller policy */}
   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);

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

   elm_run();

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