\section{button\+\_\+example\+\_\+00.\+c}

\begin{DoxyCodeInclude}
\textcolor{comment}{/*}
\textcolor{comment}{ * gcc -o button\_example\_00 button\_example\_00.c `pkg-config --cflags --libs elementary`}
\textcolor{comment}{ */}
\textcolor{preprocessor}{#include <Elementary.h>}

\textcolor{keyword}{static} \textcolor{keywordtype}{void}
on\_click(\textcolor{keywordtype}{void} *data, Evas\_Object *obj, \textcolor{keywordtype}{void} *event\_info)
\{
   elm_exit();
\}

EAPI\_MAIN \textcolor{keywordtype}{int}
elm\_main(\textcolor{keywordtype}{int} argc, \textcolor{keywordtype}{char} **argv)
\{
   Evas\_Object *win = NULL;
   Evas\_Object *btn = NULL;

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

   \textcolor{comment}{/* Create an win, associate it with a canvas and */}
   \textcolor{comment}{/* turn it visible on WM (Window Manager).       */}
   win = elm_win_util_standard_add(\textcolor{stringliteral}{"Greetings"}, \textcolor{stringliteral}{"Hello, World!"});
   elm_win_autodel_set(win, EINA\_TRUE);

   \textcolor{comment}{/* Create a btn, associate to a function, associate */}
   \textcolor{comment}{/* to win,  give a dimension and position.          */}
   btn = elm_button_add(win);
   elm\_object\_text\_set(btn, \textcolor{stringliteral}{"Good-Bye, World!"});
   evas\_object\_smart\_callback\_add(btn, \textcolor{stringliteral}{"clicked"}, on\_click, NULL);
   evas\_object\_resize(btn, 120, 30);
   evas\_object\_move(btn, 60, 15);
   evas\_object\_show(btn);

   evas\_object\_resize(win, 240, 60);
   evas\_object\_show(win);

   elm_run();

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