\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);
   evas\_object\_resize(win, 240, 60);
   evas\_object\_show(win);

   \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);

   elm_run();
   elm_shutdown();

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