\doxysection{menu\+\_\+example\+\_\+01.\+c}
\hypertarget{menu_example_01_8c-example}{}\label{menu_example_01_8c-example}
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{\textcolor{comment}{//Compile\ with:}}
\DoxyCodeLine{\textcolor{comment}{//gcc\ -\/g\ menu\_example\_01.c\ -\/o\ menu\_example\_01\ \`{}pkg-\/config\ -\/-\/cflags\ -\/-\/libs\ elementary`}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#include\ <Elementary.h>}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_del\_it(\textcolor{keywordtype}{void}\ *data,\ Evas\_Object\ *obj\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},\ \textcolor{keywordtype}{void}\ *event\_info\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \textcolor{keyword}{const}\ \mbox{\hyperlink{struct__Eina__List}{Eina\_List}}\ *l;}
\DoxyCodeLine{\ \ \ Elm\_Object\_Item\ *menu\_it\ =\ elm\_menu\_first\_item\_get(data);}
\DoxyCodeLine{\ \ \ menu\_it\ =\ elm\_menu\_item\_next\_get(menu\_it);}
\DoxyCodeLine{\ \ \ l\ =\ elm\_menu\_item\_subitems\_get(menu\_it);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_gad1b5a0d41fa322b28000a290154ec3a4}{elm\_object\_item\_del}}(eina\_list\_data\_get(l));}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_show(\textcolor{keywordtype}{void}\ *data,\ Evas\ *e\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},\ Evas\_Object\ *obj\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},\ \textcolor{keywordtype}{void}\ *event\_info)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{struct__Evas__Event__Mouse__Down}{Evas\_Event\_Mouse\_Down}}\ *ev\ =\ event\_info;}
\DoxyCodeLine{\ \ \ elm\_menu\_move(data,\ ev-\/>\mbox{\hyperlink{struct__Evas__Event__Mouse__Down_adcaa4cd5eadd8c04cc5510a5b2514eb5}{canvas}}.\mbox{\hyperlink{struct__Evas__Coord__Point_ad809771faf3700a1492e4465336e6b1e}{x}},\ ev-\/>\mbox{\hyperlink{struct__Evas__Event__Mouse__Down_adcaa4cd5eadd8c04cc5510a5b2514eb5}{canvas}}.\mbox{\hyperlink{struct__Evas__Coord__Point_ad7450d6ad43e6a7394af6807721144f7}{y}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(data);}
\DoxyCodeLine{\}}
\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,\ *menu,\ *button,\ *rect;}
\DoxyCodeLine{\ \ \ Elm\_Object\_Item\ *menu\_it,\ *menu\_it1;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ win\ =\ \mbox{\hyperlink{group__Elm__Win__Group_ga23d9d1ffa0a65a1a1dd482d570db1ba0}{elm\_win\_util\_standard\_add}}(\textcolor{stringliteral}{"{}menu"{}},\ \textcolor{stringliteral}{"{}Menu"{}});}
\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__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{\ \ \ rect\ =\ \mbox{\hyperlink{group__Evas__Object__Rectangle_ga1b7a9d8e6ce240590c1734da5f3449d2}{evas\_object\_rectangle\_add}}(\mbox{\hyperlink{group__Evas__Object__Group_ga7e211219d11abced5f3089362f7476b9}{evas\_object\_evas\_get}}(win));}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Win__Group_ga505d6bd217e5ee01e82b548ec35986eb}{elm\_win\_resize\_object\_add}}(win,\ rect);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_gaf20fdb7dc524a95091d72d24cf6a05e8}{evas\_object\_size\_hint\_min\_set}}(rect,\ 0,\ 0);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_gab751e9d24c16e74af6f7c08ea5b930c2}{evas\_object\_color\_set}}(rect,\ 0,\ 0,\ 0,\ 0);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(rect);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ menu\ =\ \mbox{\hyperlink{group__Elm__Menu_gab5d9f82f2078b1ff0330dbc1b9a5f8fb}{elm\_menu\_add}}(win);}
\DoxyCodeLine{\ \ \ elm\_menu\_item\_add(menu,\ NULL,\ NULL,\ \textcolor{stringliteral}{"{}first\ item"{}},\ NULL,\ NULL);}
\DoxyCodeLine{\ \ \ menu\_it\ =\ elm\_menu\_item\_add(menu,\ NULL,\ \textcolor{stringliteral}{"{}mail-\/reply-\/all"{}},\ \textcolor{stringliteral}{"{}second\ item"{}},\ NULL,\ NULL);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ elm\_menu\_item\_add(menu,\ menu\_it,\ \textcolor{stringliteral}{"{}object-\/rotate-\/left"{}},\ \textcolor{stringliteral}{"{}menu\ 1"{}},\ NULL,\ NULL);}
\DoxyCodeLine{\ \ \ button\ =\ \mbox{\hyperlink{group__Elm__Button_gaf5caf46d74c4e122a18da323935d25e4}{elm\_button\_add}}(win);}
\DoxyCodeLine{\ \ \ elm\_object\_text\_set(button,\ \textcolor{stringliteral}{"{}button\ -\/\ delete\ items"{}});}
\DoxyCodeLine{\ \ \ menu\_it1\ =\ elm\_menu\_item\_add(menu,\ menu\_it,\ NULL,\ NULL,\ NULL,\ NULL);}
\DoxyCodeLine{\ \ \ elm\_object\_item\_content\_set(menu\_it1,\ button);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Smart__Object__Group_gac12dd6655f488cc47ce6cf00eb7d12b2}{evas\_object\_smart\_callback\_add}}(button,\ \textcolor{stringliteral}{"{}clicked"{}},\ \_del\_it,\ menu);}
\DoxyCodeLine{\ \ \ elm\_menu\_item\_separator\_add(menu,\ menu\_it);}
\DoxyCodeLine{\ \ \ elm\_menu\_item\_add(menu,\ menu\_it,\ NULL,\ \textcolor{stringliteral}{"{}third\ item"{}},\ NULL,\ NULL);}
\DoxyCodeLine{\ \ \ elm\_menu\_item\_add(menu,\ menu\_it,\ NULL,\ \textcolor{stringliteral}{"{}fourth\ item"{}},\ NULL,\ NULL);}
\DoxyCodeLine{\ \ \ elm\_menu\_item\_add(menu,\ menu\_it,\ \textcolor{stringliteral}{"{}window-\/new"{}},\ \textcolor{stringliteral}{"{}sub\ menu"{}},\ NULL,\ NULL);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ menu\_it\ =\ elm\_menu\_item\_add(menu,\ NULL,\ NULL,\ \textcolor{stringliteral}{"{}third\ item"{}},\ NULL,\ NULL);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_ga1d4c8d3c83ed9408eaa35d605adbd7d2}{elm\_object\_item\_disabled\_set}}(menu\_it,\ \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Events_gac71a1038dad71da36f57b70c8ad10252}{evas\_object\_event\_callback\_add}}(rect,\ \mbox{\hyperlink{Evas__Common_8h_ad64cde0da38a60e7cb7905b3ab216968a9fa52651ccf7e47cd3b7785fc4cf393f}{EVAS\_CALLBACK\_MOUSE\_DOWN}},\ \_show,\ menu);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(menu);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_gacad94595f83580c18908cb3b69b08d1a}{evas\_object\_resize}}(win,\ 250,\ 350);}
\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}}()}

\end{DoxyCodeInclude}
 