

For this example we are going to assume knowledge of evas smart callbacks and some basic evas object functions. Elementary is not meant to be used without evas, if you\textquotesingle{}re not yet familiar with evas it probably is worth checking that out.

And now to the example, when using Elementary we start by including Elementary.\+h\+: 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{\textcolor{preprocessor}{\#include\ <Elementary.h>}}

\end{DoxyCodeInclude}
 Next we define some callbacks, they all share the same signature because they are all to be used with \mbox{\hyperlink{group__Evas__Smart__Object__Group_gac12dd6655f488cc47ce6cf00eb7d12b2}{evas\+\_\+object\+\_\+smart\+\_\+callback\+\_\+add()}}. The first one just prints the selected label(in two different ways)\+: 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}\ \_pos\_selected\_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\_info)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ printf(\textcolor{stringliteral}{"{}Selection:\ \%s\(\backslash\)n"{}},\ (\textcolor{keywordtype}{char}\ *)event\_info);}
\DoxyCodeLine{\ \ \ printf(\textcolor{stringliteral}{"{}Label\ selected:\ \%s\(\backslash\)n"{}},\ elm\_actionslider\_selected\_label\_get(obj));}
\DoxyCodeLine{\}}

\end{DoxyCodeInclude}
 This next callback is a little more interesting, it makes the selected label magnetic(except if it\textquotesingle{}s the center label)\+: 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_position\_change\_magnetic\_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\_info)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (!strcmp((\textcolor{keywordtype}{char}\ *)event\_info,\ \textcolor{stringliteral}{"{}left"{}}))}
\DoxyCodeLine{\ \ \ \ \ elm\_actionslider\_magnet\_pos\_set(obj,\ \mbox{\hyperlink{group__Elm__Actionslider_gga3c3924da13a094d1042b3ce092eefbcea41ff40a6b33327aabdf490a7b633d128}{ELM\_ACTIONSLIDER\_LEFT}});}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (!strcmp((\textcolor{keywordtype}{char}\ *)event\_info,\ \textcolor{stringliteral}{"{}right"{}}))}
\DoxyCodeLine{\ \ \ \ \ elm\_actionslider\_magnet\_pos\_set(obj,\ \mbox{\hyperlink{group__Elm__Actionslider_gga3c3924da13a094d1042b3ce092eefbceaf8d862e344443d07eaf92b8492069d17}{ELM\_ACTIONSLIDER\_RIGHT}});}
\DoxyCodeLine{\}}

\end{DoxyCodeInclude}
 This callback enables or disables the magnetic property of the center label\+: 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_magnet\_enable\_disable\_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\_info)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (!strcmp((\textcolor{keywordtype}{char}\ *)event\_info,\ \textcolor{stringliteral}{"{}left"{}}))}
\DoxyCodeLine{\ \ \ \ \ elm\_actionslider\_magnet\_pos\_set(obj,\ \mbox{\hyperlink{group__Elm__Actionslider_gga3c3924da13a094d1042b3ce092eefbceaa211fa2272b5536b29f6bbb099652c67}{ELM\_ACTIONSLIDER\_CENTER}});}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (!strcmp((\textcolor{keywordtype}{char}\ *)event\_info,\ \textcolor{stringliteral}{"{}right"{}}))}
\DoxyCodeLine{\ \ \ \ \ elm\_actionslider\_magnet\_pos\_set(obj,\ \mbox{\hyperlink{group__Elm__Actionslider_gga3c3924da13a094d1042b3ce092eefbcea251910c2db1ec34a6b02c384088c812e}{ELM\_ACTIONSLIDER\_NONE}});}
\DoxyCodeLine{\}}

\end{DoxyCodeInclude}
 And finally a callback to stop the main loop when the window is closed\+: 
\begin{DoxyCodeInclude}{0}
\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{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}}\ *win,\ *bx,\ *as;}
\DoxyCodeLine{}
\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}{"{}actionslider"{}},\ \textcolor{stringliteral}{"{}Actionslider"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Win__Group_ga9a16a2f8c9fd5b6e9203ed9dcb53ea8b}{elm\_win\_autodel\_set}}(win,\ \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ bx\ =\ \mbox{\hyperlink{group__Elm__Box__Group_ga49ec615c90bf8bead2158d5ffab2e445}{elm\_box\_add}}(win);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_ga9379629ad8ad2860aa786d838a4a106a}{evas\_object\_size\_hint\_weight\_set}}(bx,\ \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}},\ 0);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Win__Group_ga505d6bd217e5ee01e82b548ec35986eb}{elm\_win\_resize\_object\_add}}(win,\ bx);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(bx);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ as\ =\ \mbox{\hyperlink{group__Elm__Actionslider_ga631b471e079d30e52c3b38c4293242af}{elm\_actionslider\_add}}(win);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_ga9379629ad8ad2860aa786d838a4a106a}{evas\_object\_size\_hint\_weight\_set}}(as,\ \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}},\ 0);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_gaaf1d3e26e36b316977336066b6f56632}{evas\_object\_size\_hint\_align\_set}}(as,\ \mbox{\hyperlink{Evas__Common_8h_aecbac710f36d52911fc34dcdaf8e729c}{EVAS\_HINT\_FILL}},\ 0);}
\DoxyCodeLine{\ \ \ elm\_actionslider\_indicator\_pos\_set(as,\ \mbox{\hyperlink{group__Elm__Actionslider_gga3c3924da13a094d1042b3ce092eefbceaf8d862e344443d07eaf92b8492069d17}{ELM\_ACTIONSLIDER\_RIGHT}});}
\DoxyCodeLine{\ \ \ elm\_actionslider\_magnet\_pos\_set(as,\ \mbox{\hyperlink{group__Elm__Actionslider_gga3c3924da13a094d1042b3ce092eefbceaf8d862e344443d07eaf92b8492069d17}{ELM\_ACTIONSLIDER\_RIGHT}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_ga9c088563c442670796564d2e5158f154}{elm\_object\_part\_text\_set}}(as,\ \textcolor{stringliteral}{"{}left"{}},\ \textcolor{stringliteral}{"{}Snooze"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_ga9c088563c442670796564d2e5158f154}{elm\_object\_part\_text\_set}}(as,\ \textcolor{stringliteral}{"{}right"{}},\ \textcolor{stringliteral}{"{}Stop"{}});}
\DoxyCodeLine{\ \ \ elm\_actionslider\_enabled\_pos\_set(as,\ \mbox{\hyperlink{group__Elm__Actionslider_gga3c3924da13a094d1042b3ce092eefbcea41ff40a6b33327aabdf490a7b633d128}{ELM\_ACTIONSLIDER\_LEFT}}\ |}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{group__Elm__Actionslider_gga3c3924da13a094d1042b3ce092eefbceaf8d862e344443d07eaf92b8492069d17}{ELM\_ACTIONSLIDER\_RIGHT}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Smart__Object__Group_gac12dd6655f488cc47ce6cf00eb7d12b2}{evas\_object\_smart\_callback\_add}}(as,\ \textcolor{stringliteral}{"{}pos\_changed"{}},}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \_position\_change\_magnetic\_cb,\ NULL);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Smart__Object__Group_gac12dd6655f488cc47ce6cf00eb7d12b2}{evas\_object\_smart\_callback\_add}}(as,\ \textcolor{stringliteral}{"{}selected"{}},\ \_pos\_selected\_cb,\ NULL);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(as);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Box__Group_ga66a10dd861578521af2ab7b8c2ca65c5}{elm\_box\_pack\_end}}(bx,\ as);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ as\ =\ \mbox{\hyperlink{group__Elm__Actionslider_ga631b471e079d30e52c3b38c4293242af}{elm\_actionslider\_add}}(win);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_ga9379629ad8ad2860aa786d838a4a106a}{evas\_object\_size\_hint\_weight\_set}}(as,\ \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}},\ 0);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_gaaf1d3e26e36b316977336066b6f56632}{evas\_object\_size\_hint\_align\_set}}(as,\ \mbox{\hyperlink{Evas__Common_8h_aecbac710f36d52911fc34dcdaf8e729c}{EVAS\_HINT\_FILL}},\ 0);}
\DoxyCodeLine{\ \ \ elm\_actionslider\_indicator\_pos\_set(as,\ \mbox{\hyperlink{group__Elm__Actionslider_gga3c3924da13a094d1042b3ce092eefbceaa211fa2272b5536b29f6bbb099652c67}{ELM\_ACTIONSLIDER\_CENTER}});}
\DoxyCodeLine{\ \ \ elm\_actionslider\_magnet\_pos\_set(as,\ \mbox{\hyperlink{group__Elm__Actionslider_gga3c3924da13a094d1042b3ce092eefbceaa211fa2272b5536b29f6bbb099652c67}{ELM\_ACTIONSLIDER\_CENTER}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_ga9c088563c442670796564d2e5158f154}{elm\_object\_part\_text\_set}}(as,\ \textcolor{stringliteral}{"{}left"{}},\ \textcolor{stringliteral}{"{}Snooze"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_ga9c088563c442670796564d2e5158f154}{elm\_object\_part\_text\_set}}(as,\ \textcolor{stringliteral}{"{}right"{}},\ \textcolor{stringliteral}{"{}Stop"{}});}
\DoxyCodeLine{\ \ \ elm\_actionslider\_enabled\_pos\_set(as,\ \mbox{\hyperlink{group__Elm__Actionslider_gga3c3924da13a094d1042b3ce092eefbcea41ff40a6b33327aabdf490a7b633d128}{ELM\_ACTIONSLIDER\_LEFT}}\ |}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{group__Elm__Actionslider_gga3c3924da13a094d1042b3ce092eefbceaf8d862e344443d07eaf92b8492069d17}{ELM\_ACTIONSLIDER\_RIGHT}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Smart__Object__Group_gac12dd6655f488cc47ce6cf00eb7d12b2}{evas\_object\_smart\_callback\_add}}(as,\ \textcolor{stringliteral}{"{}selected"{}},\ \_pos\_selected\_cb,\ NULL);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(as);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Box__Group_ga66a10dd861578521af2ab7b8c2ca65c5}{elm\_box\_pack\_end}}(bx,\ as);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ as\ =\ \mbox{\hyperlink{group__Elm__Actionslider_ga631b471e079d30e52c3b38c4293242af}{elm\_actionslider\_add}}(win);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Styles_ga7fc2d1f9ba723470da7a05799c49f7fe}{elm\_object\_style\_set}}(as,\ \textcolor{stringliteral}{"{}bar"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_ga9379629ad8ad2860aa786d838a4a106a}{evas\_object\_size\_hint\_weight\_set}}(as,\ \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}},\ 0);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_gaaf1d3e26e36b316977336066b6f56632}{evas\_object\_size\_hint\_align\_set}}(as,\ \mbox{\hyperlink{Evas__Common_8h_aecbac710f36d52911fc34dcdaf8e729c}{EVAS\_HINT\_FILL}},\ 0);}
\DoxyCodeLine{\ \ \ elm\_actionslider\_indicator\_pos\_set(as,\ \mbox{\hyperlink{group__Elm__Actionslider_gga3c3924da13a094d1042b3ce092eefbcea41ff40a6b33327aabdf490a7b633d128}{ELM\_ACTIONSLIDER\_LEFT}});}
\DoxyCodeLine{\ \ \ elm\_actionslider\_magnet\_pos\_set(as,\ \mbox{\hyperlink{group__Elm__Actionslider_gga3c3924da13a094d1042b3ce092eefbceaa211fa2272b5536b29f6bbb099652c67}{ELM\_ACTIONSLIDER\_CENTER}}|}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{group__Elm__Actionslider_gga3c3924da13a094d1042b3ce092eefbceaf8d862e344443d07eaf92b8492069d17}{ELM\_ACTIONSLIDER\_RIGHT}});}
\DoxyCodeLine{\ \ \ elm\_actionslider\_enabled\_pos\_set(as,\ \mbox{\hyperlink{group__Elm__Actionslider_gga3c3924da13a094d1042b3ce092eefbceaa211fa2272b5536b29f6bbb099652c67}{ELM\_ACTIONSLIDER\_CENTER}}\ |}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{group__Elm__Actionslider_gga3c3924da13a094d1042b3ce092eefbceaf8d862e344443d07eaf92b8492069d17}{ELM\_ACTIONSLIDER\_RIGHT}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_ga9c088563c442670796564d2e5158f154}{elm\_object\_part\_text\_set}}(as,\ \textcolor{stringliteral}{"{}center"{}},\ \textcolor{stringliteral}{"{}Accept"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_ga9c088563c442670796564d2e5158f154}{elm\_object\_part\_text\_set}}(as,\ \textcolor{stringliteral}{"{}right"{}},\ \textcolor{stringliteral}{"{}Reject"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Smart__Object__Group_gac12dd6655f488cc47ce6cf00eb7d12b2}{evas\_object\_smart\_callback\_add}}(as,\ \textcolor{stringliteral}{"{}selected"{}},\ \_pos\_selected\_cb,\ NULL);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(as);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Box__Group_ga66a10dd861578521af2ab7b8c2ca65c5}{elm\_box\_pack\_end}}(bx,\ as);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ as\ =\ \mbox{\hyperlink{group__Elm__Actionslider_ga631b471e079d30e52c3b38c4293242af}{elm\_actionslider\_add}}(win);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Styles_ga7fc2d1f9ba723470da7a05799c49f7fe}{elm\_object\_style\_set}}(as,\ \textcolor{stringliteral}{"{}bar"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_ga9379629ad8ad2860aa786d838a4a106a}{evas\_object\_size\_hint\_weight\_set}}(as,\ \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}},\ 0);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_gaaf1d3e26e36b316977336066b6f56632}{evas\_object\_size\_hint\_align\_set}}(as,\ \mbox{\hyperlink{Evas__Common_8h_aecbac710f36d52911fc34dcdaf8e729c}{EVAS\_HINT\_FILL}},\ 0);}
\DoxyCodeLine{\ \ \ elm\_actionslider\_indicator\_pos\_set(as,\ \mbox{\hyperlink{group__Elm__Actionslider_gga3c3924da13a094d1042b3ce092eefbcea41ff40a6b33327aabdf490a7b633d128}{ELM\_ACTIONSLIDER\_LEFT}});}
\DoxyCodeLine{\ \ \ elm\_actionslider\_magnet\_pos\_set(as,\ \mbox{\hyperlink{group__Elm__Actionslider_gga3c3924da13a094d1042b3ce092eefbcea41ff40a6b33327aabdf490a7b633d128}{ELM\_ACTIONSLIDER\_LEFT}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_ga9c088563c442670796564d2e5158f154}{elm\_object\_part\_text\_set}}(as,\ \textcolor{stringliteral}{"{}center"{}},\ \textcolor{stringliteral}{"{}Accept"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_ga9c088563c442670796564d2e5158f154}{elm\_object\_part\_text\_set}}(as,\ \textcolor{stringliteral}{"{}right"{}},\ \textcolor{stringliteral}{"{}Reject"{}});}
\DoxyCodeLine{\ \ \ elm\_object\_text\_set(as,\ \textcolor{stringliteral}{"{}Go"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Smart__Object__Group_gac12dd6655f488cc47ce6cf00eb7d12b2}{evas\_object\_smart\_callback\_add}}(as,\ \textcolor{stringliteral}{"{}pos\_changed"{}},}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \_position\_change\_magnetic\_cb,\ NULL);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Smart__Object__Group_gac12dd6655f488cc47ce6cf00eb7d12b2}{evas\_object\_smart\_callback\_add}}(as,\ \textcolor{stringliteral}{"{}selected"{}},\ \_pos\_selected\_cb,\ NULL);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(as);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Box__Group_ga66a10dd861578521af2ab7b8c2ca65c5}{elm\_box\_pack\_end}}(bx,\ as);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ as\ =\ \mbox{\hyperlink{group__Elm__Actionslider_ga631b471e079d30e52c3b38c4293242af}{elm\_actionslider\_add}}(win);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_ga9379629ad8ad2860aa786d838a4a106a}{evas\_object\_size\_hint\_weight\_set}}(as,\ \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}},\ 0);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_gaaf1d3e26e36b316977336066b6f56632}{evas\_object\_size\_hint\_align\_set}}(as,\ \mbox{\hyperlink{Evas__Common_8h_aecbac710f36d52911fc34dcdaf8e729c}{EVAS\_HINT\_FILL}},\ 0);}
\DoxyCodeLine{\ \ \ elm\_actionslider\_indicator\_pos\_set(as,\ \mbox{\hyperlink{group__Elm__Actionslider_gga3c3924da13a094d1042b3ce092eefbcea41ff40a6b33327aabdf490a7b633d128}{ELM\_ACTIONSLIDER\_LEFT}});}
\DoxyCodeLine{\ \ \ elm\_actionslider\_magnet\_pos\_set(as,\ \mbox{\hyperlink{group__Elm__Actionslider_gga3c3924da13a094d1042b3ce092eefbcea1d16cd7e3aca27dbe288d2379d4e626d}{ELM\_ACTIONSLIDER\_ALL}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_ga9c088563c442670796564d2e5158f154}{elm\_object\_part\_text\_set}}(as,\ \textcolor{stringliteral}{"{}left"{}},\ \textcolor{stringliteral}{"{}Left"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_ga9c088563c442670796564d2e5158f154}{elm\_object\_part\_text\_set}}(as,\ \textcolor{stringliteral}{"{}center"{}},\ \textcolor{stringliteral}{"{}Center"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_ga9c088563c442670796564d2e5158f154}{elm\_object\_part\_text\_set}}(as,\ \textcolor{stringliteral}{"{}right"{}},\ \textcolor{stringliteral}{"{}Right"{}});}
\DoxyCodeLine{\ \ \ elm\_object\_text\_set(as,\ \textcolor{stringliteral}{"{}Go"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Smart__Object__Group_gac12dd6655f488cc47ce6cf00eb7d12b2}{evas\_object\_smart\_callback\_add}}(as,\ \textcolor{stringliteral}{"{}selected"{}},\ \_pos\_selected\_cb,\ NULL);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(as);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Box__Group_ga66a10dd861578521af2ab7b8c2ca65c5}{elm\_box\_pack\_end}}(bx,\ as);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ as\ =\ \mbox{\hyperlink{group__Elm__Actionslider_ga631b471e079d30e52c3b38c4293242af}{elm\_actionslider\_add}}(win);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_ga9379629ad8ad2860aa786d838a4a106a}{evas\_object\_size\_hint\_weight\_set}}(as,\ \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}},\ 0);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_gaaf1d3e26e36b316977336066b6f56632}{evas\_object\_size\_hint\_align\_set}}(as,\ \mbox{\hyperlink{Evas__Common_8h_aecbac710f36d52911fc34dcdaf8e729c}{EVAS\_HINT\_FILL}},\ 0);}
\DoxyCodeLine{\ \ \ elm\_actionslider\_indicator\_pos\_set(as,\ \mbox{\hyperlink{group__Elm__Actionslider_gga3c3924da13a094d1042b3ce092eefbceaa211fa2272b5536b29f6bbb099652c67}{ELM\_ACTIONSLIDER\_CENTER}});}
\DoxyCodeLine{\ \ \ elm\_actionslider\_magnet\_pos\_set(as,\ \mbox{\hyperlink{group__Elm__Actionslider_gga3c3924da13a094d1042b3ce092eefbceaa211fa2272b5536b29f6bbb099652c67}{ELM\_ACTIONSLIDER\_CENTER}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_ga9c088563c442670796564d2e5158f154}{elm\_object\_part\_text\_set}}(as,\ \textcolor{stringliteral}{"{}left"{}},\ \textcolor{stringliteral}{"{}Enable"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_ga9c088563c442670796564d2e5158f154}{elm\_object\_part\_text\_set}}(as,\ \textcolor{stringliteral}{"{}center"{}},\ \textcolor{stringliteral}{"{}Magnet"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_ga9c088563c442670796564d2e5158f154}{elm\_object\_part\_text\_set}}(as,\ \textcolor{stringliteral}{"{}right"{}},\ \textcolor{stringliteral}{"{}Disable"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Smart__Object__Group_gac12dd6655f488cc47ce6cf00eb7d12b2}{evas\_object\_smart\_callback\_add}}(as,\ \textcolor{stringliteral}{"{}pos\_changed"{}},}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \_magnet\_enable\_disable\_cb,\ NULL);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Smart__Object__Group_gac12dd6655f488cc47ce6cf00eb7d12b2}{evas\_object\_smart\_callback\_add}}(as,\ \textcolor{stringliteral}{"{}selected"{}},\ \_pos\_selected\_cb,\ NULL);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(as);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Box__Group_ga66a10dd861578521af2ab7b8c2ca65c5}{elm\_box\_pack\_end}}(bx,\ as);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_gacad94595f83580c18908cb3b69b08d1a}{evas\_object\_resize}}(win,\ 320,\ 400);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(win);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_gadf2553f83e6b0b9c7fbe054019a664a1}{elm\_run}}();}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{return}\ 0;}
\DoxyCodeLine{\}}

\end{DoxyCodeInclude}
 To be able to create our actionsliders we need to do some setup, but this isn\textquotesingle{}t really relevant here, so if you want to know about that go here.

With all that boring stuff out of the way we can proceed to creating some actionsliders.~\newline
All actionsliders are created the same way\+: 
\begin{DoxyCodeInclude}{0}

\end{DoxyCodeInclude}
Next we must choose where the indicator starts, and for this one we choose the right, and set the right as magnetic\+: 
\begin{DoxyCodeInclude}{0}

\end{DoxyCodeInclude}
 We then set the labels for the left and right, passing NULL as an argument to any of the labels makes that position have no label. 
\begin{DoxyCodeInclude}{0}

\end{DoxyCodeInclude}
 Furthermore we mark both left and right as enabled positions, if we didn\textquotesingle{}t do this all three positions would be enabled\+: 
\begin{DoxyCodeInclude}{0}

\end{DoxyCodeInclude}
 Having the enabled positions we now add a smart callback to change which position is magnetic, so that only the last selected position is magnetic\+: 
\begin{DoxyCodeInclude}{0}

\end{DoxyCodeInclude}
 And finally we set our printing callback and show the actionslider\+: 
\begin{DoxyCodeInclude}{0}

\end{DoxyCodeInclude}
 For our next actionslider we are going to do much as we did for the previous except we are going to have the center as the magnet(and not change it)\+: 
\begin{DoxyCodeInclude}{0}

\end{DoxyCodeInclude}
 And another actionslider, in this one the indicator starts on the left. It has labels only in the center and right, and both positions are magnetic. Because the left doesn\textquotesingle{}t have a label and is not magnetic once the indicator leaves it can\textquotesingle{}t return\+: 
\begin{DoxyCodeInclude}{0}

\end{DoxyCodeInclude}
\begin{DoxyNote}{Note}
The greyed out area is a style.
\end{DoxyNote}
And now an actionslider with a label in the indicator, and whose magnet properties change based on what was last selected\+: 
\begin{DoxyCodeInclude}{0}

\end{DoxyCodeInclude}
\begin{DoxyNote}{Note}
The greyed out area is a style.
\end{DoxyNote}
We are almost done, this next one is just an actionslider with all positions magnetized and having every possible label\+: 
\begin{DoxyCodeInclude}{0}

\end{DoxyCodeInclude}
 And for our last actionslider we have one that turns the magnetic property on and off\+: 
\begin{DoxyCodeInclude}{0}

\end{DoxyCodeInclude}
 The example will look like this\+:

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


See the full source code \mbox{\hyperlink{actionslider_example_01}{here}} 