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

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