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

   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);

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

   elm_run();

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