\section{hover\+\_\+example\+\_\+01.\+c}

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

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

\textcolor{keyword}{static} \textcolor{keywordtype}{void}
\_show\_hover(\textcolor{keywordtype}{void} *data, Evas\_Object *obj, \textcolor{keywordtype}{void} *event\_info)
\{
   evas\_object\_show(data);
\}

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

EAPI\_MAIN \textcolor{keywordtype}{int}
elm\_main(\textcolor{keywordtype}{int} argc, \textcolor{keywordtype}{char} **argv)
\{
   Evas\_Object *win, *bt, *bt2, *rect, *rect2, *rect3, *hover;

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

   win = elm_win_util_standard_add(\textcolor{stringliteral}{"hover"}, \textcolor{stringliteral}{"Hover"});
   elm\_win\_autodel\_set(win, EINA\_TRUE);

   rect = evas\_object\_rectangle\_add(evas\_object\_evas\_get(win));
   evas\_object\_size\_hint\_min\_set(rect, 25, 25);
   evas\_object\_color\_set(rect, 255, 0, 0, 255);
   evas\_object\_show(rect);

   rect2 = evas\_object\_rectangle\_add(evas\_object\_evas\_get(win));
   evas\_object\_size\_hint\_min\_set(rect2, 25, 25);
   evas\_object\_color\_set(rect2, 0, 255, 0, 255);
   evas\_object\_show(rect2);

   rect3 = evas\_object\_rectangle\_add(evas\_object\_evas\_get(win));
   evas\_object\_size\_hint\_min\_set(rect3, 25, 25);
   evas\_object\_color\_set(rect3, 0, 0, 255, 255);
   evas\_object\_show(rect3);

   bt = elm_button_add(win);
   elm\_object\_text\_set(bt, \textcolor{stringliteral}{"Show hover"});
   evas\_object\_move(bt, 60, 90);
   evas\_object\_resize(bt, 80, 20);
   evas\_object\_show(bt);

   bt2 = elm_button_add(win);
   elm\_object\_text\_set(bt2, \textcolor{stringliteral}{"Hide hover"});
   evas\_object\_show(bt2);

   hover = elm_hover_add(win);
   elm_hover_parent_set(hover, win);
   elm\_hover\_target\_set(hover, bt);

   elm_object_style_set(hover, \textcolor{stringliteral}{"popout"});

   elm_object_part_content_set(hover, \textcolor{stringliteral}{"left"}, rect);
   elm_object_part_content_set(hover, \textcolor{stringliteral}{"top"}, rect2);
   elm_object_part_content_set(hover, \textcolor{stringliteral}{"right"}, rect3);
   elm_object_part_content_set(hover, \textcolor{stringliteral}{"middle"}, bt2);

   evas\_object\_smart\_callback\_add(bt, \textcolor{stringliteral}{"clicked"}, \_show\_hover, hover);
   evas\_object\_smart\_callback\_add(bt2, \textcolor{stringliteral}{"clicked"}, \_hide\_hover, hover);

   evas\_object\_resize(win, 200, 200);
   evas\_object\_show(win);

   elm_run();

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