

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__Group_ga23d9d1ffa0a65a1a1dd482d570db1ba0}{elm\_win\_util\_standard\_add}}(\textcolor{stringliteral}{"{}label"{}},\ \textcolor{stringliteral}{"{}Label"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Win__Group_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__Group_ga39a584d245f8a4b18d742e3ede702507}{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{\ \ \ \mbox{\hyperlink{group__Elm__Label__Group_ga6c89f8dfb03ae06797708b90d7926f01}{elm\_label\_slide\_duration\_set}}(label,\ 3);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Label__Group_ga6cad055d2cd4ea72f9d6c9ce8bd68421}{elm\_label\_slide\_mode\_set}}(label,\ \mbox{\hyperlink{group__Elm__Label__Group_gga6a12dc6d96304f9f757d85eb73d21acea069cdd23117efca1a5c984fab3c02243}{ELM\_LABEL\_SLIDE\_MODE\_ALWAYS}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Styles_ga7fc2d1f9ba723470da7a05799c49f7fe}{elm\_object\_style\_set}}(label,\ \textcolor{stringliteral}{"{}slide\_bounce"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_ga335c8ee6eaeaac9710656af4f8b0db91}{evas\_object\_move}}(label,\ 0,\ 10);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_gacad94595f83580c18908cb3b69b08d1a}{evas\_object\_resize}}(label,\ 200,\ 15);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{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__Group_ga39a584d245f8a4b18d742e3ede702507}{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{\ \ \ \mbox{\hyperlink{group__Elm__Label__Group_gacde1f9668d9afa17935569ec01f21377}{elm\_label\_ellipsis\_set}}(label2,\ \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_gacad94595f83580c18908cb3b69b08d1a}{evas\_object\_resize}}(label2,\ 200,\ 15);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_ga335c8ee6eaeaac9710656af4f8b0db91}{evas\_object\_move}}(label2,\ 0,\ 30);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{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__Group_ga39a584d245f8a4b18d742e3ede702507}{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{\ \ \ \mbox{\hyperlink{group__Elm__Label__Group_ga60a1dad4d49a3aea31ced12e30d0b815}{elm\_label\_line\_wrap\_set}}(label3,\ \mbox{\hyperlink{group__Elm__General_ggab5ef300e5e95d85a1b22f46a767d6d87a5c3fd8d34f49fb999dbfb4368284e698}{ELM\_WRAP\_CHAR}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Label__Group_gacde1f9668d9afa17935569ec01f21377}{elm\_label\_ellipsis\_set}}(label3,\ \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_gacad94595f83580c18908cb3b69b08d1a}{evas\_object\_resize}}(label3,\ 200,\ 15);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_ga335c8ee6eaeaac9710656af4f8b0db91}{evas\_object\_move}}(label3,\ 0,\ 50);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{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__Group_ga39a584d245f8a4b18d742e3ede702507}{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{\ \ \ \mbox{\hyperlink{group__Elm__Label__Group_ga60a1dad4d49a3aea31ced12e30d0b815}{elm\_label\_line\_wrap\_set}}(label4,\ \mbox{\hyperlink{group__Elm__General_ggab5ef300e5e95d85a1b22f46a767d6d87a5c3fd8d34f49fb999dbfb4368284e698}{ELM\_WRAP\_CHAR}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_gacad94595f83580c18908cb3b69b08d1a}{evas\_object\_resize}}(label4,\ 200,\ 30);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_ga335c8ee6eaeaac9710656af4f8b0db91}{evas\_object\_move}}(label4,\ 0,\ 80);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{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__Group_ga39a584d245f8a4b18d742e3ede702507}{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{\ \ \ \mbox{\hyperlink{group__Elm__Label__Group_ga60a1dad4d49a3aea31ced12e30d0b815}{elm\_label\_line\_wrap\_set}}(label5,\ \mbox{\hyperlink{group__Elm__General_ggab5ef300e5e95d85a1b22f46a767d6d87a1373d085d34064eba644cde86c0f95a6}{ELM\_WRAP\_WORD}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_gacad94595f83580c18908cb3b69b08d1a}{evas\_object\_resize}}(label5,\ 200,\ 40);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_ga335c8ee6eaeaac9710656af4f8b0db91}{evas\_object\_move}}(label5,\ 0,\ 110);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{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__Group_ga39a584d245f8a4b18d742e3ede702507}{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_gab751e9d24c16e74af6f7c08ea5b930c2}{evas\_object\_color\_set}}(label6,\ 255,\ 0,\ 0,\ 255);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_gacad94595f83580c18908cb3b69b08d1a}{evas\_object\_resize}}(label6,\ 200,\ 15);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_ga335c8ee6eaeaac9710656af4f8b0db91}{evas\_object\_move}}(label6,\ 0,\ 140);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(label6);}

\end{DoxyCodeInclude}
 Our example will look like this\+:

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