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

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

\textcolor{keyword}{static} \textcolor{keywordtype}{void} \_block\_clicked(\textcolor{keywordtype}{void} *data, Evas\_Object *obj, \textcolor{keywordtype}{void} *event\_info);
\textcolor{keyword}{static} \textcolor{keywordtype}{void} \_timeout(\textcolor{keywordtype}{void} *data, Evas\_Object *obj, \textcolor{keywordtype}{void} *event\_info);

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

   win = elm_win_util_standard_add(\textcolor{stringliteral}{"popup"}, \textcolor{stringliteral}{"Popup"});
   elm_win_autodel_set(win, EINA\_TRUE);
   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

   content = elm_label_add(win);
   elm\_object\_text\_set(content, \textcolor{stringliteral}{"<align=center>Content</align>"});

   popup = elm_popup_add(win);
   elm_popup_timeout_set(popup, 3.0);
   evas\_object\_smart\_callback\_add(popup, \textcolor{stringliteral}{"timeout"}, \_timeout, NULL);

   \textcolor{comment}{//Setting popup content}
   elm\_object\_content\_set(popup, content);
   \textcolor{comment}{//Seting popup title-text}
   elm_object_part_text_set(popup, \textcolor{stringliteral}{"title,text"}, \textcolor{stringliteral}{"Title"});
   evas\_object\_show(popup);
   evas\_object\_smart\_callback\_add(popup, \textcolor{stringliteral}{"block,clicked"}, \_block\_clicked, NULL);

   evas\_object\_resize(win, 480, 800);
   evas\_object\_show(win);

   elm_run();

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

static \textcolor{keywordtype}{void}
\_block\_clicked(\textcolor{keywordtype}{void} *data, Evas\_Object *obj,
               \textcolor{keywordtype}{void} *event\_info)
\{
   evas\_object\_hide(obj);
\}

\textcolor{keyword}{static} \textcolor{keywordtype}{void}
\_timeout(\textcolor{keywordtype}{void} *data, Evas\_Object *obj, \textcolor{keywordtype}{void} *event\_info)
\{
   evas\_object\_hide(obj);
\}
\end{DoxyCodeInclude}


This example will initially look like this\+:

 
\begin{DoxyImageNoCaption}
  \mbox{\includegraphics[width=\textwidth]{screenshots/popup_example_01}}
\end{DoxyImageNoCaption}


Once the popup is hidden after timeout\+:

 
\begin{DoxyImageNoCaption}
  \mbox{\includegraphics[width=\textwidth]{screenshots/popup_example_01_a}}
\end{DoxyImageNoCaption}
 