This code places a single Elementary list widgets on a window, exemplifying a part of the widget\textquotesingle{}s A\+PI.

First, we will just create a simple list, as done on \hyperlink{list_example_01}{List widget example} \+:  
\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"}
     \};
   li = elm_list_add(win);
   evas\_object\_size\_hint\_weight\_set(li, EVAS\_HINT\_EXPAND, EVAS\_HINT\_EXPAND);
   elm\_win\_resize\_object\_add(win, li);

   \textcolor{keywordflow}{for} (i = 0; i < \textcolor{keyword}{sizeof}(lbl) / \textcolor{keyword}{sizeof}(lbl[0]); i++)
     elm\_list\_item\_append(li, lbl[i], NULL, NULL, NULL, NULL);

\end{DoxyCodeInclude}


Now, let\textquotesingle{}s customize this list a bit. First we will display items horizontally\+: 
\begin{DoxyCodeInclude}
   elm\_list\_horizontal\_set(li, EINA\_TRUE);

\end{DoxyCodeInclude}


Then we will choose another list mode. There are four of them, and the default \#\+Elm\+\_\+\+List\+\_\+\+Mode is \#\+E\+L\+M\+\_\+\+L\+I\+S\+T\+\_\+\+S\+C\+R\+O\+LL. Let\textquotesingle{}s set compress mode\+: 
\begin{DoxyCodeInclude}
   elm\_list\_mode\_set(li, ELM\_LIST\_COMPRESS);

\end{DoxyCodeInclude}


To enable multiple items selection, we need to enable it, since only one selected item is allowed by default\+: 
\begin{DoxyCodeInclude}
   elm\_list\_multi\_select\_set(li, EINA\_TRUE);

\end{DoxyCodeInclude}


We are not adding items with callback functions here, since we\textquotesingle{}ll explain it better on \hyperlink{list_example_03}{List -\/ Items management}. But if the callback need to be called everytime user clicks an item, even if already selected, it\textquotesingle{}s required to enable this behavior\+: 
\begin{DoxyCodeInclude}
   elm\_list\_select\_mode\_set(li, ELM\_OBJECT\_SELECT\_MODE\_ALWAYS);

\end{DoxyCodeInclude}


Finally, if a bounce effect is required, or you would like to see scrollbars, it is possible. But, for default theme, list scrollbars will be invisible anyway. 
\begin{DoxyCodeInclude}
   elm_scroller_bounce_set(li, EINA\_TRUE, EINA\_TRUE);
   elm_scroller_policy_set(li, ELM\_SCROLLER\_POLICY\_AUTO,
                           ELM\_SCROLLER\_POLICY\_ON);

\end{DoxyCodeInclude}


See the full \hyperlink{list_example_02_8c-example}{list\+\_\+example\+\_\+02.c} code, whose window should look like this picture\+:

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