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

\begin{DoxyCodeInclude}
\textcolor{comment}{//Compile with:}
\textcolor{comment}{//gcc -o check\_example\_01  check\_example\_01.c -g `pkg-config --cflags --libs elementary`}

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

\textcolor{keyword}{static} \textcolor{keywordtype}{void}
\_print(\textcolor{keywordtype}{void} *data, Evas\_Object *obj, \textcolor{keywordtype}{void} *event\_info)
\{
   printf(\textcolor{stringliteral}{"check %smarked\(\backslash\)n"}, *((Eina\_Bool*)data) ? \textcolor{stringliteral}{""} : \textcolor{stringliteral}{"un"});
\}

EAPI\_MAIN \textcolor{keywordtype}{int}
elm\_main(\textcolor{keywordtype}{int} argc, \textcolor{keywordtype}{char} **argv)
\{
   Evas\_Object *win, *cb, *cb2, *icon;
   Eina\_Bool value;

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

   win = elm_win_util_standard_add(\textcolor{stringliteral}{"check"}, \textcolor{stringliteral}{"Check"});
   elm\_win\_autodel\_set(win, EINA\_TRUE);

   cb = elm_check_add(win);
   elm\_object\_text\_set(cb, \textcolor{stringliteral}{"checkbox"});
   elm\_check\_state\_pointer\_set(cb, &value);
   evas\_object\_smart\_callback\_add(cb, \textcolor{stringliteral}{"changed"}, \_print, &value);
   evas\_object\_move(cb, 10, 10);
   evas\_object\_resize(cb, 200, 30);
   evas\_object\_show(cb);

   icon = evas\_object\_rectangle\_add(evas\_object\_evas\_get(win));
   evas\_object\_color\_set(icon, 0, 255, 0, 255);
   evas\_object\_resize(icon, 20, 20);
   evas\_object\_show(icon);

   cb2 = elm_check_add(win);
   elm\_object\_text\_set(cb2, \textcolor{stringliteral}{"another checkbox"});
   elm\_check\_state\_set(cb2, EINA\_TRUE);
   elm_object_part_content_set(cb2, \textcolor{stringliteral}{"icon"}, icon);
   evas\_object\_move(cb2, 10, 50);
   evas\_object\_resize(cb2, 200, 30);
   evas\_object\_show(cb2);

   evas\_object\_resize(win, 200, 100);
   evas\_object\_show(win);

   elm_run();

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