\section{theme\+\_\+example\+\_\+02.\+c}

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

\textcolor{keyword}{static} \textcolor{keywordtype}{void}
\_btn\_clicked\_cb(\textcolor{keywordtype}{void} *data, Evas\_Object *obj, \textcolor{keywordtype}{void} *ev)
\{
   \textcolor{keyword}{static} \textcolor{keywordtype}{int} loaded = 1;
   \textcolor{keywordflow}{if} (loaded)
     elm_theme_overlay_del(NULL, \textcolor{stringliteral}{"./theme\_example.edj"});
   \textcolor{keywordflow}{else}
     elm_theme_overlay_add(NULL, \textcolor{stringliteral}{"./theme\_example.edj"});
   loaded = 1 - loaded;
\}

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

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

   elm_theme_overlay_add(NULL, \textcolor{stringliteral}{"./theme\_example.edj"});

   win = elm_win_util_standard_add(\textcolor{stringliteral}{"theme"}, \textcolor{stringliteral}{"Theme example"});
   elm_win_autodel_set(win, EINA\_TRUE);

   box = elm_box_add(win);
   evas\_object\_size\_hint\_weight\_set(box, EVAS\_HINT\_EXPAND, EVAS\_HINT\_EXPAND);
   elm_win_resize_object_add(win, box);
   evas\_object\_show(box);

   btn = elm_button_add(win);
   elm\_object\_text\_set(btn, \textcolor{stringliteral}{"Button 1"});
   elm_box_pack_end(box, btn);
   evas\_object\_show(btn);
   evas\_object\_smart\_callback\_add(btn, \textcolor{stringliteral}{"clicked"}, \_btn\_clicked\_cb, NULL);

   btn = elm_button_add(win);
   elm\_object\_text\_set(btn, \textcolor{stringliteral}{"Button 2"});
   elm_box_pack_end(box, btn);
   evas\_object\_show(btn);
   evas\_object\_smart\_callback\_add(btn, \textcolor{stringliteral}{"clicked"}, \_btn\_clicked\_cb, NULL);

   btn = elm_button_add(win);
   elm\_object\_text\_set(btn, \textcolor{stringliteral}{"Button 3"});
   elm_box_pack_end(box, btn);
   evas\_object\_show(btn);
   evas\_object\_smart\_callback\_add(btn, \textcolor{stringliteral}{"clicked"}, \_btn\_clicked\_cb, NULL);

   btn = elm_button_add(win);
   elm\_object\_text\_set(btn, \textcolor{stringliteral}{"Button 4"});
   elm_box_pack_end(box, btn);
   evas\_object\_show(btn);
   evas\_object\_smart\_callback\_add(btn, \textcolor{stringliteral}{"clicked"}, \_btn\_clicked\_cb, NULL);

   evas\_object\_resize(win, 300, 320);
   evas\_object\_show(win);

   elm_run();

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