Inwin is a very simple widget to show, so this example will be a very simple one, just using all of the available API.

The program is nothing but a window with a lonely button, as shown here.

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


And pressing the button makes an inwin appear.

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


And the code is just as simple. We being with some global variables to keep track of our Inwin.  
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{\textcolor{keyword}{static}\ \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}}\ *inwin\ =\ NULL;}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *styles[]\ =\ \{}
\DoxyCodeLine{\ \ \ \ \ \textcolor{stringliteral}{"{}default"{}},}
\DoxyCodeLine{\ \ \ \ \ \textcolor{stringliteral}{"{}minimal"{}},}
\DoxyCodeLine{\ \ \ \ \ \textcolor{stringliteral}{"{}minimal\_vertical"{}}}
\DoxyCodeLine{\};}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{int}\ current\_style\ =\ 0;}

\end{DoxyCodeInclude}
 And two callbacks used by the buttons the above screenshot showed. In these, we check if {\ttfamily inwin} exists and execute the proper action on it. If it\textquotesingle{}s not there anymore, then we were abandoned to our luck, so we disabled ourselves. 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_inwin\_hide(\textcolor{keywordtype}{void}\ *data\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},\ \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}}\ *obj,\ \textcolor{keywordtype}{void}\ *event\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (inwin)}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_gae66f71e09a0dc71675f15ebff6765c64}{evas\_object\_hide}}(inwin);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{return};}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ elm\_object\_text\_set(obj,\ \textcolor{stringliteral}{"{}No\ inwin!"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_ga6849a57df3316eabad5bec443bf87597}{elm\_object\_disabled\_set}}(obj,\ \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_inwin\_destroy(\textcolor{keywordtype}{void}\ *data\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},\ \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}}\ *obj,\ \textcolor{keywordtype}{void}\ *event\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (inwin)}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9217cf1d90690dbd1960db155d1c7476}{evas\_object\_del}}(inwin);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ inwin\ =\ NULL;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{return};}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ elm\_object\_text\_set(obj,\ \textcolor{stringliteral}{"{}No\ inwin!"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_ga6849a57df3316eabad5bec443bf87597}{elm\_object\_disabled\_set}}(obj,\ \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{\}}

\end{DoxyCodeInclude}
 The lonely button from the beginning, when clicked, will call the following function, which begins by checking if an inwin exists, and if it\textquotesingle{}s there, we bring it back to the front and exit from our function without any further ado. 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_btn\_click\_cb(\textcolor{keywordtype}{void}\ *data\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},\ \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}}\ *obj,\ \textcolor{keywordtype}{void}\ *event\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}}\ *o,\ *parent;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (inwin)}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \mbox{\hyperlink{group__Elm__Inwin__Group_ga4a9563c589ae3ab597e0caefb5f7477e}{elm\_win\_inwin\_activate}}(inwin);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{return};}
\DoxyCodeLine{\ \ \ \ \ \}}

\end{DoxyCodeInclude}
 But if no inwin is there to show, we need to create one. First we need the top-\/most window for the program, as no inwin can be created using other objects as parents. Then we create our popup, set the next style in the list and show it. 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ parent\ =\ \mbox{\hyperlink{group__Elm__WidgetNavigation_gada78cebf8263f033bd8e97244d948d89}{elm\_object\_top\_widget\_get}}(obj);}
\DoxyCodeLine{\ \ \ inwin\ =\ \mbox{\hyperlink{group__Elm__Inwin__Group_ga318183a28e45ff7c7010781c5fe56789}{elm\_win\_inwin\_add}}(parent);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Styles_ga7fc2d1f9ba723470da7a05799c49f7fe}{elm\_object\_style\_set}}(inwin,\ styles[current\_style]);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(inwin);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ current\_style\ =\ (current\_style\ +\ 1)\ \%\ 3;}

\end{DoxyCodeInclude}
 As for the content of our inwin, it\textquotesingle{}s just a box with a label and some buttons inside. 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ o\ =\ \mbox{\hyperlink{group__Elm__Box__Group_ga49ec615c90bf8bead2158d5ffab2e445}{elm\_box\_add}}(parent);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_ga9379629ad8ad2860aa786d838a4a106a}{evas\_object\_size\_hint\_weight\_set}}(o,\ \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}},\ \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_gaaf1d3e26e36b316977336066b6f56632}{evas\_object\_size\_hint\_align\_set}}(o,\ \mbox{\hyperlink{Evas__Common_8h_aecbac710f36d52911fc34dcdaf8e729c}{EVAS\_HINT\_FILL}},\ \mbox{\hyperlink{Evas__Common_8h_aecbac710f36d52911fc34dcdaf8e729c}{EVAS\_HINT\_FILL}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Inwin__Group_gaeb4bd299e4d9b4dc040ac29e1b1d6b1e}{elm\_win\_inwin\_content\_set}}(inwin,\ o);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(o);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ o\ =\ \mbox{\hyperlink{group__Elm__Label__Group_ga39a584d245f8a4b18d742e3ede702507}{elm\_label\_add}}(parent);}
\DoxyCodeLine{\ \ \ elm\_object\_text\_set(o,\ \textcolor{stringliteral}{"{}Click\ on\ the\ first\ button\ to\ hide\ the\ Inwin.<ps>"{}}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}Second\ to\ destroy\ it<ps>"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(o);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Box__Group_ga66a10dd861578521af2ab7b8c2ca65c5}{elm\_box\_pack\_end}}(\mbox{\hyperlink{group__Elm__Inwin__Group_ga1277c03a1fc6d85453920359b2a9a6be}{elm\_win\_inwin\_content\_get}}(inwin),\ o);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ o\ =\ \mbox{\hyperlink{group__Elm__Button_gaf5caf46d74c4e122a18da323935d25e4}{elm\_button\_add}}(parent);}
\DoxyCodeLine{\ \ \ elm\_object\_text\_set(o,\ \textcolor{stringliteral}{"{}Hide"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(o);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Smart__Object__Group_gac12dd6655f488cc47ce6cf00eb7d12b2}{evas\_object\_smart\_callback\_add}}(o,\ \textcolor{stringliteral}{"{}clicked"{}},\ \_inwin\_hide,\ NULL);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Box__Group_ga66a10dd861578521af2ab7b8c2ca65c5}{elm\_box\_pack\_end}}(\mbox{\hyperlink{group__Elm__Inwin__Group_ga1277c03a1fc6d85453920359b2a9a6be}{elm\_win\_inwin\_content\_get}}(inwin),\ o);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ o\ =\ \mbox{\hyperlink{group__Elm__Button_gaf5caf46d74c4e122a18da323935d25e4}{elm\_button\_add}}(parent);}
\DoxyCodeLine{\ \ \ elm\_object\_text\_set(o,\ \textcolor{stringliteral}{"{}Destroy"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(o);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Smart__Object__Group_gac12dd6655f488cc47ce6cf00eb7d12b2}{evas\_object\_smart\_callback\_add}}(o,\ \textcolor{stringliteral}{"{}clicked"{}},\ \_inwin\_destroy,\ NULL);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Box__Group_ga66a10dd861578521af2ab7b8c2ca65c5}{elm\_box\_pack\_end}}(\mbox{\hyperlink{group__Elm__Inwin__Group_ga1277c03a1fc6d85453920359b2a9a6be}{elm\_win\_inwin\_content\_get}}(inwin),\ o);}
\DoxyCodeLine{\}}

\end{DoxyCodeInclude}
 Now, all the code above shows how every object must always be set as content for some other object, be it by setting the full content, packing it in a box or table or working as icon for some other widget. But we didn\textquotesingle{}t do anything like that for the inwin, this one is just created and shown and everything works. Other widgets can be used this way, but they would need to be placed and resized manually or nothing would be shown correctly. The inwin, however, sets itself as a children of the top-\/level window and will be resized as the parent window changes too.

Another characteristic of Inwin is that when it\textquotesingle{}s shown above everyone else, it will work kind of like a modal window, blocking any other widget from receiving events until the window is manually dismissed by pressing some button to close it or having blocking task signalling its completion so normal operations can be resumed. This is unlike the \mbox{\hyperlink{group__Elm__Hover}{Hover}} widget, that would show its content on top of the designated target, but clicking anywhere else would dismiss it automatically.

To illustrate that last point, when we close the main window and an inwin is still there, we\textquotesingle{}ll take out the content from the inwin and place it in a hover. 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_win\_del\_cb(\textcolor{keywordtype}{void}\ *data\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},\ \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}}\ *obj,\ \textcolor{keywordtype}{void}\ *event\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (inwin)}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}}\ *hover,\ *o\ =\ \mbox{\hyperlink{group__Elm__Inwin__Group_ga72b3f94dcbf2cf8ad9b0e08c4325671e}{elm\_win\_inwin\_content\_unset}}(inwin);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9217cf1d90690dbd1960db155d1c7476}{evas\_object\_del}}(inwin);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ inwin\ =\ NULL;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ hover\ =\ \mbox{\hyperlink{group__Elm__Hover_gab005e27e2e9a1d57d2789c86c6c292af}{elm\_hover\_add}}(obj);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ elm\_hover\_target\_set(hover,\ obj);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \mbox{\hyperlink{group__Elm__General_ga0531ec8867c72def7c780601764ca642}{elm\_object\_part\_content\_set}}(hover,\ \textcolor{stringliteral}{"{}middle"{}},\ o);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(hover);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{return};}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9217cf1d90690dbd1960db155d1c7476}{evas\_object\_del}}(obj);}
\DoxyCodeLine{\}}

\end{DoxyCodeInclude}
 And the rest of the program doesn\textquotesingle{}t have anything else related to inwin, so it won\textquotesingle{}t be shown here, but you can find it in \mbox{\hyperlink{inwin_example_8c-example}{inwin\+\_\+example.c}}. 