\doxysection{segment\+\_\+control\+\_\+example.\+c}
\hypertarget{segment_control_example_8c-example}{}\label{segment_control_example_8c-example}
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#include\ <Elementary.h>}}
\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,\ *sc,\ *ic;}
\DoxyCodeLine{\ \ \ Elm\_Object\_Item\ *seg\_it;}
\DoxyCodeLine{\ \ \ \textcolor{keywordtype}{int}\ count,\ idx;}
\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}{"{}segment\_control"{}},\ \textcolor{stringliteral}{"{}Segment\ Control\ 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{\ \ \ sc\ =\ \mbox{\hyperlink{group__Elm__Segment__Control_ga0e8e51178442d70548e700efbf1fb041}{elm\_segment\_control\_add}}(win);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_ga9379629ad8ad2860aa786d838a4a106a}{evas\_object\_size\_hint\_weight\_set}}(sc,\ \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,\ sc);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(sc);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ elm\_segment\_control\_item\_add(sc,\ NULL,\ \textcolor{stringliteral}{"{}only\ text"{}});}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ ic\ =\ \mbox{\hyperlink{group__Elm__Icon_gac369f2d67be417e5cff81e8f001ff326}{elm\_icon\_add}}(win);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Icon_gab764b4c6c90543f254c013eff6a6db66}{elm\_icon\_standard\_set}}(ic,\ \textcolor{stringliteral}{"{}close"{}});}
\DoxyCodeLine{\ \ \ elm\_segment\_control\_item\_add(sc,\ ic,\ NULL);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ ic\ =\ \mbox{\hyperlink{group__Elm__Icon_gac369f2d67be417e5cff81e8f001ff326}{elm\_icon\_add}}(win);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Icon_gab764b4c6c90543f254c013eff6a6db66}{elm\_icon\_standard\_set}}(ic,\ \textcolor{stringliteral}{"{}home"{}});}
\DoxyCodeLine{\ \ \ elm\_segment\_control\_item\_add(sc,\ ic,\ \textcolor{stringliteral}{"{}Home"{}});}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ ic\ =\ \mbox{\hyperlink{group__Elm__Icon_gac369f2d67be417e5cff81e8f001ff326}{elm\_icon\_add}}(win);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Icon_gab764b4c6c90543f254c013eff6a6db66}{elm\_icon\_standard\_set}}(ic,\ \textcolor{stringliteral}{"{}close"{}});}
\DoxyCodeLine{\ \ \ elm\_segment\_control\_item\_add(sc,\ ic,\ \textcolor{stringliteral}{"{}"{}});}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ count\ =\ elm\_segment\_control\_item\_count\_get(sc);}
\DoxyCodeLine{\ \ \ elm\_segment\_control\_item\_insert\_at(sc,\ NULL,\ \textcolor{stringliteral}{"{}Inserted\ at"{}},\ count\ -\/\ 1);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ seg\_it\ =\ elm\_segment\_control\_item\_insert\_at(sc,\ NULL,\ \textcolor{stringliteral}{"{}To\ be\ deleted"{}},\ 2);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_gad1b5a0d41fa322b28000a290154ec3a4}{elm\_object\_item\_del}}(seg\_it);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ elm\_segment\_control\_item\_insert\_at(sc,\ NULL,\ \textcolor{stringliteral}{"{}To\ be\ deleted"{}},\ 2);}
\DoxyCodeLine{\ \ \ elm\_segment\_control\_item\_del\_at(sc,\ 2);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ seg\_it\ =\ elm\_segment\_control\_item\_get(sc,\ 0);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_gab7192654621dd090be86c94678635ea4}{elm\_object\_item\_text\_set}}(seg\_it,\ \textcolor{stringliteral}{"{}Only\ Text"{}});}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ count\ =\ elm\_segment\_control\_item\_count\_get(sc);}
\DoxyCodeLine{\ \ \ seg\_it\ =\ elm\_segment\_control\_item\_get(sc,\ count\ /\ 2);}
\DoxyCodeLine{\ \ \ elm\_segment\_control\_item\_selected\_set(seg\_it,\ \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{\ \ \ seg\_it\ =\ elm\_segment\_control\_item\_selected\_get(sc);}
\DoxyCodeLine{\ \ \ idx\ =\ elm\_segment\_control\_item\_index\_get(seg\_it);}
\DoxyCodeLine{\ \ \ printf(\textcolor{stringliteral}{"{}Item\ selected:\ \%i\(\backslash\)n"{}},\ idx);}
\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}}()}

\end{DoxyCodeInclude}
 