

In this example we are going to create 6 labels, set some properties on them and see what changes in appearance those properties cause.

We start with the setup code that by now you should be familiar with\+: 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{\textcolor{comment}{//Compile with:}}
\DoxyCodeLine{\textcolor{comment}{//gcc -\/o label\_example\_01 label\_example\_01.c -\/g `pkg-\/config -\/-\/cflags -\/-\/libs elementary`}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <Elementary.h>}}
\DoxyCodeLine{}
\DoxyCodeLine{EAPI\_MAIN \textcolor{keywordtype}{int}}
\DoxyCodeLine{elm\_main(\textcolor{keywordtype}{int} argc \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}}, \textcolor{keywordtype}{char} **argv \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *win, *label, *label2, *label3, *label4, *label5, *label6;}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__General_ga7a05f37fd3a019da5e26c5fc91fcd937}{elm\_policy\_set}}(\mbox{\hyperlink{group__Elm__General_ggaa16f3378ecdbf660fa378402e3c5a0a9a02fadb6faada04b19d0fa42c11a8d32a}{ELM\_POLICY\_QUIT}}, \mbox{\hyperlink{group__Elm__General_gga46af37e6ac2c406321060be827117196abbe0962d88ae12afe1a173da881f56cd}{ELM\_POLICY\_QUIT\_LAST\_WINDOW\_CLOSED}});}
\DoxyCodeLine{}
\DoxyCodeLine{   win = \mbox{\hyperlink{group__Elm__Win_gac75d7752662fab73d6420706ce5be996}{elm\_win\_util\_standard\_add}}(\textcolor{stringliteral}{"label"}, \textcolor{stringliteral}{"Label"});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Win_ga9a16a2f8c9fd5b6e9203ed9dcb53ea8b}{elm\_win\_autodel\_set}}(win, \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}

\end{DoxyCodeInclude}


For our first label we have a moderately long text(that doesn\textquotesingle{}t fit in the label\textquotesingle{}s width) so we will make it a sliding label. Since the text isn\textquotesingle{}t too long we don\textquotesingle{}t need the animation to be very long, 3 seconds should give us a nice speed\+: 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{   label = \mbox{\hyperlink{group__Elm__Label_ga01e161a300e3ee6f7a13a44505724e03}{elm\_label\_add}}(win);}
\DoxyCodeLine{   elm\_object\_text\_set(label, \textcolor{stringliteral}{"Some long text for our label, that is long but "}}
\DoxyCodeLine{                       \textcolor{stringliteral}{"not too long."});}
\DoxyCodeLine{   elm\_label\_slide\_duration\_set(label, 3);}
\DoxyCodeLine{   elm\_label\_slide\_mode\_set(label, \mbox{\hyperlink{group__Elm__Label_gga6a12dc6d96304f9f757d85eb73d21acea069cdd23117efca1a5c984fab3c02243}{ELM\_LABEL\_SLIDE\_MODE\_ALWAYS}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Styles_ga7fc2d1f9ba723470da7a05799c49f7fe}{elm\_object\_style\_set}}(label, \textcolor{stringliteral}{"slide\_bounce"});}
\DoxyCodeLine{   evas\_object\_move(label, 0, 10);}
\DoxyCodeLine{   evas\_object\_resize(label, 200, 15);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(label);}

\end{DoxyCodeInclude}


For our second label we have the same text, but this time we aren\textquotesingle{}t going to have it slide, we\textquotesingle{}re going to ellipsize it. Because we ask our label widget to ellipsize the text it will first diminsh the fontsize so that it can show as much of the text as possible\+: 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{   label2 = \mbox{\hyperlink{group__Elm__Label_ga01e161a300e3ee6f7a13a44505724e03}{elm\_label\_add}}(win);}
\DoxyCodeLine{   elm\_object\_text\_set(label2, \textcolor{stringliteral}{"This is the text for our second label, which is"}}
\DoxyCodeLine{                       \textcolor{stringliteral}{" much longer than the previous one, maybe even "}}
\DoxyCodeLine{                       \textcolor{stringliteral}{"too long, but maybe not."});}
\DoxyCodeLine{   elm\_label\_ellipsis\_set(label2, \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{   evas\_object\_resize(label2, 200, 15);}
\DoxyCodeLine{   evas\_object\_move(label2, 0, 30);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(label2);}

\end{DoxyCodeInclude}


For the third label we are going to ellipsize the text again, however this time to make sure the fontsize isn\textquotesingle{}t diminshed we will set a line wrap. The wrap won\textquotesingle{}t actually cause a line break because we set the label to ellipsize\+: 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{   label3 = \mbox{\hyperlink{group__Elm__Label_ga01e161a300e3ee6f7a13a44505724e03}{elm\_label\_add}}(win);}
\DoxyCodeLine{   elm\_object\_text\_set(label3, \textcolor{stringliteral}{"Some more long text much as before, long but "}}
\DoxyCodeLine{                       \textcolor{stringliteral}{"not too long."});}
\DoxyCodeLine{   elm\_label\_line\_wrap\_set(label3, \mbox{\hyperlink{group__Elm__General_ggab5ef300e5e95d85a1b22f46a767d6d87a5c3fd8d34f49fb999dbfb4368284e698}{ELM\_WRAP\_CHAR}});}
\DoxyCodeLine{   elm\_label\_ellipsis\_set(label3, \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{   evas\_object\_resize(label3, 200, 15);}
\DoxyCodeLine{   evas\_object\_move(label3, 0, 50);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(label3);}

\end{DoxyCodeInclude}


For our fourth label we will set line wrapping but won\textquotesingle{}t set ellipsis, so that our text will indeed be wrapped instead of ellipsized. For this label we choose character wrap\+: 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{   label4 = \mbox{\hyperlink{group__Elm__Label_ga01e161a300e3ee6f7a13a44505724e03}{elm\_label\_add}}(win);}
\DoxyCodeLine{   elm\_object\_text\_set(label4, \textcolor{stringliteral}{"And for this label we choose a different text, "}}
\DoxyCodeLine{                       \textcolor{stringliteral}{"for no reason other than that we can."});}
\DoxyCodeLine{   elm\_label\_line\_wrap\_set(label4, \mbox{\hyperlink{group__Elm__General_ggab5ef300e5e95d85a1b22f46a767d6d87a5c3fd8d34f49fb999dbfb4368284e698}{ELM\_WRAP\_CHAR}});}
\DoxyCodeLine{   evas\_object\_resize(label4, 200, 30);}
\DoxyCodeLine{   evas\_object\_move(label4, 0, 80);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(label4);}

\end{DoxyCodeInclude}


Just two more, for our fifth label we do the same as for the fourth except we set the wrap to word\+: 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{   label5 = \mbox{\hyperlink{group__Elm__Label_ga01e161a300e3ee6f7a13a44505724e03}{elm\_label\_add}}(win);}
\DoxyCodeLine{   elm\_object\_text\_set(label5, \textcolor{stringliteral}{"And for this label we choose a different text, "}}
\DoxyCodeLine{                       \textcolor{stringliteral}{"for no reason other than that we can."});}
\DoxyCodeLine{   elm\_label\_line\_wrap\_set(label5, \mbox{\hyperlink{group__Elm__General_ggab5ef300e5e95d85a1b22f46a767d6d87a1373d085d34064eba644cde86c0f95a6}{ELM\_WRAP\_WORD}});}
\DoxyCodeLine{   evas\_object\_resize(label5, 200, 40);}
\DoxyCodeLine{   evas\_object\_move(label5, 0, 110);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(label5);}

\end{DoxyCodeInclude}


And last but not least for our sixth label we set the style to \char`\"{}marker\char`\"{} and the color to red (the default color is white which would be hard to see on our white background)\+: 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{   label6 = \mbox{\hyperlink{group__Elm__Label_ga01e161a300e3ee6f7a13a44505724e03}{elm\_label\_add}}(win);}
\DoxyCodeLine{   elm\_object\_text\_set(label6, \textcolor{stringliteral}{"Short text"});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Styles_ga7fc2d1f9ba723470da7a05799c49f7fe}{elm\_object\_style\_set}}(label6, \textcolor{stringliteral}{"marker"});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}}(label6, 255, 0, 0, 255);}
\DoxyCodeLine{   evas\_object\_resize(label6, 200, 15);}
\DoxyCodeLine{   evas\_object\_move(label6, 0, 140);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(label6);}

\end{DoxyCodeInclude}


Our example will look like this\+:

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