\hypertarget{ecore_event_example_01_8c-example}{}\section{ecore\+\_\+event\+\_\+example\+\_\+01.\+c}
This example shows how to create an event handler. Explanation\+: \hyperlink{ecore_event_example_01_c}{Handling events example}


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

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

\textcolor{keyword}{static} \hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}
\_quitter(\textcolor{keywordtype}{void} *data \hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}, \textcolor{keywordtype}{int} ev\_type EINA\_UNUSED, \textcolor{keywordtype}{void} *event EINA\_UNUSED)
\{
   printf(\textcolor{stringliteral}{"Leaving already?\(\backslash\)n"});
   \hyperlink{group__Ecore__Main__Loop__Group_ga95cf8e97dff0716433c2c5474d606a98}{ecore\_main\_loop\_quit}();
   \textcolor{keywordflow}{return} \hyperlink{group__Ecore__Main__Loop__Group_ga780091d7d49a4bb6cb753f12e1a3b19d}{ECORE\_CALLBACK\_DONE};
\}

\textcolor{keywordtype}{int}
main(\textcolor{keywordtype}{void})
\{
   \hyperlink{group__Ecore__Init__Group_ga77757609684a2c922dc5ec398274751b}{ecore\_init}();

   \hyperlink{group__Ecore__Event__Group_gae75b0b1b2c50e73b8e42afc628b00a62}{ecore\_event\_handler\_add}(\hyperlink{group__Ecore__Event__Group_ga0dd1e36930ae8fa8decc97564d57f310}{ECORE\_EVENT\_SIGNAL\_EXIT}, \_quitter,
       NULL);
   \hyperlink{group__Ecore__Main__Loop__Group_gaf103b9f668bb3e4fed12e52c6180132d}{ecore\_main\_loop\_begin}();

   \textcolor{keywordflow}{return} 0;
\}

\end{DoxyCodeInclude}
 