\hypertarget{slider_example_8c-example}{}\doxysection{slider\+\_\+example.\+c}

\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <Elementary.h>}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_changed\_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 \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \textcolor{keywordtype}{double} val = \mbox{\hyperlink{group__Elm__Slider_ga2dd3f70cdbcb4a81b5d7a08a18afaa1d}{elm\_slider\_value\_get}}(obj);}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"{}Changed to \%1.2f\(\backslash\)n"{}}, val);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_delay\_changed\_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 \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \textcolor{keywordtype}{double} val = \mbox{\hyperlink{group__Elm__Slider_ga2dd3f70cdbcb4a81b5d7a08a18afaa1d}{elm\_slider\_value\_get}}(obj);}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"{}Delay changed to \%1.2f\(\backslash\)n"{}}, val);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{char}*}
\DoxyCodeLine{\_indicator\_format(\textcolor{keywordtype}{double} val)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \textcolor{keywordtype}{char} *indicator = malloc(\textcolor{keyword}{sizeof}(\textcolor{keywordtype}{char}) * 32);}
\DoxyCodeLine{   snprintf(indicator, 32, \textcolor{stringliteral}{"{}\%1.2f u"{}}, val);}
\DoxyCodeLine{   \textcolor{keywordflow}{return} indicator;}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_indicator\_free(\textcolor{keywordtype}{char} *str)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   free(str);}
\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{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *win, *bx, *sl, *ic;}
\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_gac75d7752662fab73d6420706ce5be996}{elm\_win\_util\_standard\_add}}(\textcolor{stringliteral}{"{}slider"{}}, \textcolor{stringliteral}{"{}Slider Example"{}});}
\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_ga3d0998b60ada633bacfa8869a921cfd7}{elm\_box\_add}}(win);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga2af897b00f32bebf08705929276386f5}{evas\_object\_size\_hint\_weight\_set}}(bx, \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}}, \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Win__Group_ga505d6bd217e5ee01e82b548ec35986eb}{elm\_win\_resize\_object\_add}}(win, bx);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(bx);}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{comment}{/* default */}}
\DoxyCodeLine{   sl = \mbox{\hyperlink{group__Elm__Slider_ga15ade2fc52942975429bb3c864a8a258}{elm\_slider\_add}}(win);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga44b67b368e5cda723129c2852bd81ead}{evas\_object\_size\_hint\_align\_set}}(sl, \mbox{\hyperlink{Evas__Common_8h_aecbac710f36d52911fc34dcdaf8e729c}{EVAS\_HINT\_FILL}}, 0.5);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga2af897b00f32bebf08705929276386f5}{evas\_object\_size\_hint\_weight\_set}}(sl, \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}}, \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Box__Group_ga66a10dd861578521af2ab7b8c2ca65c5}{elm\_box\_pack\_end}}(bx, sl);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(sl);}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{comment}{/* with icon, end and label */}}
\DoxyCodeLine{   sl = \mbox{\hyperlink{group__Elm__Slider_ga15ade2fc52942975429bb3c864a8a258}{elm\_slider\_add}}(win);}
\DoxyCodeLine{   elm\_object\_text\_set(sl, \textcolor{stringliteral}{"{}Counter"{}});}
\DoxyCodeLine{}
\DoxyCodeLine{   ic = \mbox{\hyperlink{group__Elm__Icon_ga5739728c1209f90422cf65a778a16502}{elm\_icon\_add}}(win);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Icon_gab764b4c6c90543f254c013eff6a6db66}{elm\_icon\_standard\_set}}(ic, \textcolor{stringliteral}{"{}home"{}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Image_ga6a389436a18e590fff5b6f6b81c72722}{elm\_image\_resizable\_set}}(ic, \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}}, \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__General_ga0531ec8867c72def7c780601764ca642}{elm\_object\_part\_content\_set}}(sl, \textcolor{stringliteral}{"{}icon"{}}, ic);}
\DoxyCodeLine{}
\DoxyCodeLine{   ic = \mbox{\hyperlink{group__Elm__Icon_ga5739728c1209f90422cf65a778a16502}{elm\_icon\_add}}(win);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Icon_gab764b4c6c90543f254c013eff6a6db66}{elm\_icon\_standard\_set}}(ic, \textcolor{stringliteral}{"{}folder"{}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Image_ga6a389436a18e590fff5b6f6b81c72722}{elm\_image\_resizable\_set}}(ic, \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}}, \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__General_ga0531ec8867c72def7c780601764ca642}{elm\_object\_part\_content\_set}}(sl, \textcolor{stringliteral}{"{}end"{}}, ic);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga44b67b368e5cda723129c2852bd81ead}{evas\_object\_size\_hint\_align\_set}}(sl, \mbox{\hyperlink{Evas__Common_8h_aecbac710f36d52911fc34dcdaf8e729c}{EVAS\_HINT\_FILL}}, 0.5);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga2af897b00f32bebf08705929276386f5}{evas\_object\_size\_hint\_weight\_set}}(sl, \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}}, \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Box__Group_ga66a10dd861578521af2ab7b8c2ca65c5}{elm\_box\_pack\_end}}(bx, sl);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(sl);}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{comment}{/* value set and span size */}}
\DoxyCodeLine{   sl = \mbox{\hyperlink{group__Elm__Slider_ga15ade2fc52942975429bb3c864a8a258}{elm\_slider\_add}}(win);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Slider_ga74e14a46f516a1505242bddc434f938d}{elm\_slider\_value\_set}}(sl, 1);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Slider_ga96b5e8176a6bdb4e932e32329e6fa742}{elm\_slider\_span\_size\_set}}(sl, 200);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga44b67b368e5cda723129c2852bd81ead}{evas\_object\_size\_hint\_align\_set}}(sl, \mbox{\hyperlink{Evas__Common_8h_aecbac710f36d52911fc34dcdaf8e729c}{EVAS\_HINT\_FILL}}, 0.5);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga2af897b00f32bebf08705929276386f5}{evas\_object\_size\_hint\_weight\_set}}(sl, \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}}, \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Box__Group_ga66a10dd861578521af2ab7b8c2ca65c5}{elm\_box\_pack\_end}}(bx, sl);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(sl);}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{comment}{/* with unit label and min -\/ max */}}
\DoxyCodeLine{   sl = \mbox{\hyperlink{group__Elm__Slider_ga15ade2fc52942975429bb3c864a8a258}{elm\_slider\_add}}(win);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Slider_gaa58c280b3916b35f52db525d3d921004}{elm\_slider\_unit\_format\_set}}(sl, \textcolor{stringliteral}{"{}\%1.0f units"{}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Slider_ga5368bb23df3d5253ab388195812e792b}{elm\_slider\_min\_max\_set}}(sl, 0, 100);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga44b67b368e5cda723129c2852bd81ead}{evas\_object\_size\_hint\_align\_set}}(sl, \mbox{\hyperlink{Evas__Common_8h_aecbac710f36d52911fc34dcdaf8e729c}{EVAS\_HINT\_FILL}}, 0.5);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga2af897b00f32bebf08705929276386f5}{evas\_object\_size\_hint\_weight\_set}}(sl, \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}}, \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Box__Group_ga66a10dd861578521af2ab7b8c2ca65c5}{elm\_box\_pack\_end}}(bx, sl);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(sl);}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{comment}{/* with indicator label and inverted */}}
\DoxyCodeLine{   sl = \mbox{\hyperlink{group__Elm__Slider_ga15ade2fc52942975429bb3c864a8a258}{elm\_slider\_add}}(win);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Slider_ga8d90d63bc776df76676b2d4efde094a2}{elm\_slider\_indicator\_format\_set}}(sl, \textcolor{stringliteral}{"{}\%1.2f"{}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Slider_gafb58be6aec6660c443263e6381e49a2b}{elm\_slider\_inverted\_set}}(sl, \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga44b67b368e5cda723129c2852bd81ead}{evas\_object\_size\_hint\_align\_set}}(sl, \mbox{\hyperlink{Evas__Common_8h_aecbac710f36d52911fc34dcdaf8e729c}{EVAS\_HINT\_FILL}}, 0.5);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga2af897b00f32bebf08705929276386f5}{evas\_object\_size\_hint\_weight\_set}}(sl, \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}}, \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Box__Group_ga66a10dd861578521af2ab7b8c2ca65c5}{elm\_box\_pack\_end}}(bx, sl);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(sl);}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{comment}{/* vertical with indicator format func */}}
\DoxyCodeLine{   sl = \mbox{\hyperlink{group__Elm__Slider_ga15ade2fc52942975429bb3c864a8a258}{elm\_slider\_add}}(win);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Slider_gab59b52f2d676ebd59f301ce9e34eaa17}{elm\_slider\_horizontal\_set}}(sl, \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Slider_gaf34f35f4dcc1eff5c0bf303500045aaa}{elm\_slider\_indicator\_format\_function\_set}}(sl, \_indicator\_format,}
\DoxyCodeLine{                                            \_indicator\_free);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga44b67b368e5cda723129c2852bd81ead}{evas\_object\_size\_hint\_align\_set}}(sl, 0.5, \mbox{\hyperlink{Evas__Common_8h_aecbac710f36d52911fc34dcdaf8e729c}{EVAS\_HINT\_FILL}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga2af897b00f32bebf08705929276386f5}{evas\_object\_size\_hint\_weight\_set}}(sl, 0, \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Box__Group_ga66a10dd861578521af2ab7b8c2ca65c5}{elm\_box\_pack\_end}}(bx, sl);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(sl);}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{comment}{/* callbacks */}}
\DoxyCodeLine{   sl = \mbox{\hyperlink{group__Elm__Slider_ga15ade2fc52942975429bb3c864a8a258}{elm\_slider\_add}}(win);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Slider_gaa58c280b3916b35f52db525d3d921004}{elm\_slider\_unit\_format\_set}}(sl, \textcolor{stringliteral}{"{}\%1.3f units"{}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga44b67b368e5cda723129c2852bd81ead}{evas\_object\_size\_hint\_align\_set}}(sl, \mbox{\hyperlink{Evas__Common_8h_aecbac710f36d52911fc34dcdaf8e729c}{EVAS\_HINT\_FILL}}, 0.5);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga2af897b00f32bebf08705929276386f5}{evas\_object\_size\_hint\_weight\_set}}(sl, \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}}, \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Box__Group_ga66a10dd861578521af2ab7b8c2ca65c5}{elm\_box\_pack\_end}}(bx, sl);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(sl);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Smart__Object__Group_ga18a8b179f94d21b2b09e19db11741061}{evas\_object\_smart\_callback\_add}}(sl, \textcolor{stringliteral}{"{}changed"{}}, \_changed\_cb, NULL);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Smart__Object__Group_ga18a8b179f94d21b2b09e19db11741061}{evas\_object\_smart\_callback\_add}}(sl, \textcolor{stringliteral}{"{}delay,changed"{}}, \_delay\_changed\_cb, NULL);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{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}
 