

This example shows a bubble with all fields set(label, info, content and icon) and the selected corner changing when the bubble is clicked. To be able use a bubble we need to do some setup and create a window, for this example we are going to ignore that part of the code since it isn\textquotesingle{}t relevant to the bubble.

To have the selected corner change in a clockwise motion we are going to use the following callback\+: 
\begin{DoxyCodeInclude}
   \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;
\}

\end{DoxyCodeInclude}


Here we are creating an elm\+\_\+label that is going to be used as the content for our bubble\+: 
\begin{DoxyCodeInclude}

\end{DoxyCodeInclude}
 \begin{DoxyNote}{Note}
You could use any evas\+\_\+object for this, we are using an elm\+\_\+label for simplicity.
\end{DoxyNote}
Despite it\textquotesingle{}s name the bubble\textquotesingle{}s icon doesn\textquotesingle{}t have to be an icon, it can be any evas\+\_\+object. For this example we are going to make the icon a simple blue rectangle\+: 
\begin{DoxyCodeInclude}

\end{DoxyCodeInclude}


And finally we have the actual bubble creation and the setting of it\textquotesingle{}s label, info and content\+: 
\begin{DoxyCodeInclude}

\end{DoxyCodeInclude}
 \begin{DoxyNote}{Note}
Because we didn\textquotesingle{}t set a corner, the default(\char`\"{}top\+\_\+left\char`\"{}) will be used.
\end{DoxyNote}
Now that we have our bubble all that is left is connecting the \char`\"{}clicked\char`\"{} signals to our callback\+: 
\begin{DoxyCodeInclude}

\end{DoxyCodeInclude}


This last bubble we created was very complete, so it\textquotesingle{}s pertinent to show that most of that stuff is optional a bubble can be created with nothing but content\+: 
\begin{DoxyCodeInclude}

\end{DoxyCodeInclude}


Our example will look like this\+:

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


See the full source code \hyperlink{bubble_example_01_8c-example}{bubble\+\_\+example\+\_\+01.\+c} here. 