This code places a single Elementary list widgets on a window, just to exemplify the more simple and common use case\+: a list will be created and populated with a few items.

To keep it simple, we won\textquotesingle{}t show how to customize the list, for this check \hyperlink{list_example_02}{List widget example}. Also, we won\textquotesingle{}t focus on items management on this example. For an example about this subject, check \hyperlink{list_example_03}{List -\/ Items management}.

To add a list widget.  
\begin{DoxyCodeInclude}
   li = elm_list_add(win);

\end{DoxyCodeInclude}


We are just adding the list, so as you can see, defaults for it are\+: \begin{DoxyItemize}
\item Items are displayed vertically. \item Only one item can be selected. \item The list doesn\textquotesingle{}t bounce.\end{DoxyItemize}
To add items, we are just appending it on a loop, using function elm\+\_\+list\+\_\+item\+\_\+append(), that will be better explained on items management 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"}
     \};
   \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}


After we just want to show the list. But first we need to start the widget. It was done this way to improve widget\textquotesingle{}s performance. So, always remember that\+: \begin{DoxyWarning}{Warning}
Call elm\+\_\+list\+\_\+go before showing the object 
\begin{DoxyCodeInclude}
   elm\_list\_go(li);
   evas\_object\_show(win);

\end{DoxyCodeInclude}

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

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