\section{bubble\-\_\-example\-\_\-01.\-c}

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

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

\textcolor{keywordtype}{void}
\_bla(\textcolor{keywordtype}{void} *data, Evas\_Object *obj, \textcolor{keywordtype}{void} *event\_info)
\{
   \textcolor{keyword}{static} \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} corner = 0;
   ++corner;
   \textcolor{keywordflow}{if} (corner > 3)
     elm_bubble_pos_set(obj, ELM\_BUBBLE\_POS\_TOP\_LEFT);
   \textcolor{keywordflow}{else}
     elm_bubble_pos_set(obj, corner);

\}

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

   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

   win = elm_win_util_standard_add(\textcolor{stringliteral}{"bubble"}, \textcolor{stringliteral}{"Bubble"});
   elm_win_autodel_set(win, EINA\_TRUE);
   evas\_object\_resize(win, 300, 200);
   evas\_object\_show(win);

   label = elm_label_add(win);
   elm\_object\_text\_set(label, \textcolor{stringliteral}{"This is the CONTENT of our bubble"});
   evas\_object\_show(label);

   icon = evas\_object\_rectangle\_add(evas\_object\_evas\_get(win));
   evas\_object\_color\_set(icon, 0, 0, 255, 255);
   evas\_object\_show(icon);

   bubble = elm_bubble_add(win);
   elm_object_part_content_set(bubble, \textcolor{stringliteral}{"icon"}, icon);
   elm_object_part_text_set(bubble, \textcolor{stringliteral}{"info"}, \textcolor{stringliteral}{"INFO"});
   elm\_object\_text\_set(bubble, \textcolor{stringliteral}{"LABEL"});
   elm\_object\_content\_set(bubble, label);
   evas\_object\_resize(bubble, 300, 100);
   evas\_object\_show(bubble);

   evas\_object\_smart\_callback\_add(bubble, \textcolor{stringliteral}{"clicked"}, \_bla, NULL);

   label = elm_label_add(win);
   elm\_object\_text\_set(label, \textcolor{stringliteral}{"Bubble with no icon, info or label"});
   evas\_object\_show(label);

   bubble = elm_bubble_add(win);
   elm\_object\_content\_set(bubble, label);
   evas\_object\_resize(bubble, 200, 50);
   evas\_object\_move(bubble, 0, 110);
   evas\_object\_show(bubble);

   elm_run();
   elm_shutdown();

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