\doxysection{popup\+\_\+example\+\_\+03.\+c}
\hypertarget{popup_example_03_8c-example}{}\label{popup_example_03_8c-example}
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{\textcolor{comment}{//Compile\ with:}}
\DoxyCodeLine{\textcolor{comment}{//gcc\ -\/o\ popup\_example\_03\ popup\_example\_03.c\ -\/g\ \`{}pkg-\/config\ -\/-\/cflags\ -\/-\/libs\ elementary`}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#include\ <Elementary.h>}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}\ \_item\_selected\_cb(\textcolor{keywordtype}{void}\ *data,\ Evas\_Object\ *obj,\ \textcolor{keywordtype}{void}\ *event\_info);}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}\ \_response\_cb(\textcolor{keywordtype}{void}\ *data,\ Evas\_Object\ *obj,\ \textcolor{keywordtype}{void}\ *event\_info);}
\DoxyCodeLine{}
\DoxyCodeLine{EAPI\_MAIN\ \textcolor{keywordtype}{int}}
\DoxyCodeLine{elm\_main(\textcolor{keywordtype}{int}\ argc\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},\ \textcolor{keywordtype}{char}\ **argv\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ Evas\_Object\ *win,\ *popup,\ *btn1,\ *btn2,\ *icon1;}
\DoxyCodeLine{\ \ \ Elm\_Object\_Item\ *popup\_it1;}
\DoxyCodeLine{\ \ \ \textcolor{keywordtype}{char}\ buf[256];}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__App_ga0cefb59efb95841232561d67e34d9909}{elm\_app\_info\_set}}(elm\_main,\ \textcolor{stringliteral}{"{}elementary"{}},\ \textcolor{stringliteral}{"{}images/logo\_small.png"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_ga7a05f37fd3a019da5e26c5fc91fcd937}{elm\_policy\_set}}(\mbox{\hyperlink{group__Elm__General_ggaa16f3378ecdbf660fa378402e3c5a0a9a02fadb6faada04b19d0fa42c11a8d32a}{ELM\_POLICY\_QUIT}},\ \mbox{\hyperlink{group__Elm__General_gga46af37e6ac2c406321060be827117196abbe0962d88ae12afe1a173da881f56cd}{ELM\_POLICY\_QUIT\_LAST\_WINDOW\_CLOSED}});}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ win\ =\ \mbox{\hyperlink{group__Elm__Win__Group_ga23d9d1ffa0a65a1a1dd482d570db1ba0}{elm\_win\_util\_standard\_add}}(\textcolor{stringliteral}{"{}popup"{}},\ \textcolor{stringliteral}{"{}Popup"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Win__Group_ga9a16a2f8c9fd5b6e9203ed9dcb53ea8b}{elm\_win\_autodel\_set}}(win,\ \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_gacad94595f83580c18908cb3b69b08d1a}{evas\_object\_resize}}(win,\ 480,\ 800);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ popup\ =\ \mbox{\hyperlink{group__Elm__Popup__Group_ga837b4a07133a54bcaeed8f57ac573e5a}{elm\_popup\_add}}(win);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ icon1\ =\ \mbox{\hyperlink{group__Elm__Icon_gac369f2d67be417e5cff81e8f001ff326}{elm\_icon\_add}}(popup);}
\DoxyCodeLine{\ \ \ snprintf(buf,\ \textcolor{keyword}{sizeof}(buf),\ \textcolor{stringliteral}{"{}\%s/images/logo\_small.png"{}},\ \mbox{\hyperlink{group__Elm__App_gab10cf98c5aa3936dfda01d6bca366d09}{elm\_app\_data\_dir\_get}}());}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Image_gad1a96ede5f513042cef3c1dac4572f73}{elm\_image\_file\_set}}(icon1,\ buf,\ NULL);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{comment}{//Seting\ popup\ title-\/text}}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_ga9c088563c442670796564d2e5158f154}{elm\_object\_part\_text\_set}}(popup,\ \textcolor{stringliteral}{"{}title,text"{}},\ \textcolor{stringliteral}{"{}Title"{}});}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{comment}{//Appending\ popup\ content-\/items}}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Popup__Group_ga5d44082d1e724d9156a72e5273d77567}{elm\_popup\_item\_append}}(popup,\ \textcolor{stringliteral}{"{}Message"{}},\ NULL,\ \_item\_selected\_cb,\ NULL);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Popup__Group_ga5d44082d1e724d9156a72e5273d77567}{elm\_popup\_item\_append}}(popup,\ \textcolor{stringliteral}{"{}Email"{}},\ NULL,\ \_item\_selected\_cb,\ NULL);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Popup__Group_ga5d44082d1e724d9156a72e5273d77567}{elm\_popup\_item\_append}}(popup,\ \textcolor{stringliteral}{"{}Contacts"{}},\ NULL,\ \_item\_selected\_cb,\ NULL);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Popup__Group_ga5d44082d1e724d9156a72e5273d77567}{elm\_popup\_item\_append}}(popup,\ \textcolor{stringliteral}{"{}Video"{}},\ NULL,\ \_item\_selected\_cb,\ NULL);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Popup__Group_ga5d44082d1e724d9156a72e5273d77567}{elm\_popup\_item\_append}}(popup,\ \textcolor{stringliteral}{"{}Music"{}},\ NULL,\ \_item\_selected\_cb,\ NULL);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Popup__Group_ga5d44082d1e724d9156a72e5273d77567}{elm\_popup\_item\_append}}(popup,\ \textcolor{stringliteral}{"{}Memo"{}},\ NULL,\ \_item\_selected\_cb,\ NULL);}
\DoxyCodeLine{\ \ \ popup\_it1\ =\ \mbox{\hyperlink{group__Elm__Popup__Group_ga5d44082d1e724d9156a72e5273d77567}{elm\_popup\_item\_append}}(popup,\ \textcolor{stringliteral}{"{}Radio"{}},\ NULL,\ \_item\_selected\_cb,}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ NULL);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{comment}{//Changing\ the\ label\ of\ the\ item}}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_gab7192654621dd090be86c94678635ea4}{elm\_object\_item\_text\_set}}(popup\_it1,\ \textcolor{stringliteral}{"{}FM"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Popup__Group_ga5d44082d1e724d9156a72e5273d77567}{elm\_popup\_item\_append}}(popup,\ \textcolor{stringliteral}{"{}Messenger"{}},\ NULL,\ \_item\_selected\_cb,\ NULL);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Popup__Group_ga5d44082d1e724d9156a72e5273d77567}{elm\_popup\_item\_append}}(popup,\ \textcolor{stringliteral}{"{}Settings"{}},\ NULL,\ \_item\_selected\_cb,\ NULL);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Popup__Group_ga5d44082d1e724d9156a72e5273d77567}{elm\_popup\_item\_append}}(popup,\ \textcolor{stringliteral}{"{}App\ Installer"{}},\ NULL,\ \_item\_selected\_cb,\ NULL);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Popup__Group_ga5d44082d1e724d9156a72e5273d77567}{elm\_popup\_item\_append}}(popup,\ \textcolor{stringliteral}{"{}Browser"{}},\ NULL,\ \_item\_selected\_cb,\ NULL);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Popup__Group_ga5d44082d1e724d9156a72e5273d77567}{elm\_popup\_item\_append}}(popup,\ \textcolor{stringliteral}{"{}Weather"{}},\ icon1,\ \_item\_selected\_cb,\ NULL);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Popup__Group_ga5d44082d1e724d9156a72e5273d77567}{elm\_popup\_item\_append}}(popup,\ \textcolor{stringliteral}{"{}News\ Feeds"{}},\ NULL,\ \_item\_selected\_cb,\ NULL);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{comment}{//Seting\ popup\ title-\/text}}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_ga9c088563c442670796564d2e5158f154}{elm\_object\_part\_text\_set}}(popup,\ \textcolor{stringliteral}{"{}title,text"{}},\ \textcolor{stringliteral}{"{}Title"{}});}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{comment}{//\ Creating\ the\ first\ action\ button}}
\DoxyCodeLine{\ \ \ btn1\ =\ \mbox{\hyperlink{group__Elm__Button_gaf5caf46d74c4e122a18da323935d25e4}{elm\_button\_add}}(popup);}
\DoxyCodeLine{\ \ \ elm\_object\_text\_set(btn1,\ \textcolor{stringliteral}{"{}OK"{}});}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{comment}{//Appending\ the\ fist\ action\ button}}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_ga0531ec8867c72def7c780601764ca642}{elm\_object\_part\_content\_set}}(popup,\ \textcolor{stringliteral}{"{}button1"{}},\ btn1);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Smart__Object__Group_gac12dd6655f488cc47ce6cf00eb7d12b2}{evas\_object\_smart\_callback\_add}}(btn1,\ \textcolor{stringliteral}{"{}clicked"{}},\ \_response\_cb,\ popup);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{comment}{//Creating\ the\ second\ action\ button}}
\DoxyCodeLine{\ \ \ btn2\ =\ \mbox{\hyperlink{group__Elm__Button_gaf5caf46d74c4e122a18da323935d25e4}{elm\_button\_add}}(popup);}
\DoxyCodeLine{\ \ \ elm\_object\_text\_set(btn2,\ \textcolor{stringliteral}{"{}Cancel"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Smart__Object__Group_gac12dd6655f488cc47ce6cf00eb7d12b2}{evas\_object\_smart\_callback\_add}}(btn2,\ \textcolor{stringliteral}{"{}clicked"{}},\ \_response\_cb,\ popup);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{comment}{//Appending\ the\ second\ action\ button}}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_ga0531ec8867c72def7c780601764ca642}{elm\_object\_part\_content\_set}}(popup,\ \textcolor{stringliteral}{"{}button2"{}},\ btn2);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{comment}{//Display\ the\ popup\ object}}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(popup);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(win);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_gadf2553f83e6b0b9c7fbe054019a664a1}{elm\_run}}();}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{return}\ 0;}
\DoxyCodeLine{\}}
\DoxyCodeLine{\mbox{\hyperlink{group__Elm__General_ga50fe52d513f7e89c9c770afd76de7ad9}{ELM\_MAIN}}()}
\DoxyCodeLine{}
\DoxyCodeLine{static\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_item\_selected\_cb(\textcolor{keywordtype}{void}\ *data\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},\ Evas\_Object\ *obj\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{void}\ *event\_info)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ printf(\textcolor{stringliteral}{"{}popup\ item\ selected:\ \%s\(\backslash\)n"{}},\ elm\_object\_item\_text\_get(event\_info));}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_response\_cb(\textcolor{keywordtype}{void}\ *data,\ Evas\_Object\ *obj\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{void}\ *event\_info\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_gae66f71e09a0dc71675f15ebff6765c64}{evas\_object\_hide}}(data);}
\DoxyCodeLine{\}}

\end{DoxyCodeInclude}
 