\hypertarget{fileselector_entry_example_8c-example}{}\doxysection{fileselector\+\_\+entry\+\_\+example.\+c}

\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <Elementary.h>}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{comment}{/* hook on the file,chosen smart callback */}}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_file\_chosen(\textcolor{keywordtype}{void}        *data \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},}
\DoxyCodeLine{             \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *obj \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},}
\DoxyCodeLine{             \textcolor{keywordtype}{void}        *event\_info)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \textcolor{keyword}{const} \textcolor{keywordtype}{char} *file = event\_info;}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (file)}
\DoxyCodeLine{     printf(\textcolor{stringliteral}{"File chosen: \%s\(\backslash\)n"}, file);}
\DoxyCodeLine{   \textcolor{keywordflow}{else}}
\DoxyCodeLine{     printf(\textcolor{stringliteral}{"File selection canceled.\(\backslash\)n"});}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{comment}{/* toggle inwin mode */}}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_inwin\_mode\_toggle(\textcolor{keywordtype}{void}        *data,}
\DoxyCodeLine{                   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *obj \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},}
\DoxyCodeLine{                   \textcolor{keywordtype}{void}        *event\_info \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *fs\_entry = data;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}} old\_val = elm\_fileselector\_entry\_inwin\_mode\_get(fs\_entry);}
\DoxyCodeLine{}
\DoxyCodeLine{   elm\_fileselector\_entry\_inwin\_mode\_set(fs\_entry, !old\_val);}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"Inwin mode set to: \%s\(\backslash\)n"}, old\_val ? \textcolor{stringliteral}{"false"} : \textcolor{stringliteral}{"true"});}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_current\_sel\_toggle(\textcolor{keywordtype}{void}        *data,}
\DoxyCodeLine{                    \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *obj \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},}
\DoxyCodeLine{                    \textcolor{keywordtype}{void}        *event\_info \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *fs\_entry = data;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}} old\_val = \mbox{\hyperlink{group__Elm__Fileselector_ga72f29bc1a9070aea636d95188717ee14}{elm\_fileselector\_is\_save\_get}}(fs\_entry);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Fileselector_ga3cce4da9062c9d9134d6970ebe3a65c8}{elm\_fileselector\_is\_save\_set}}(fs\_entry, !old\_val);}
\DoxyCodeLine{}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"\%s text entry with selected item's name\(\backslash\)n"},}
\DoxyCodeLine{          old\_val ? \textcolor{stringliteral}{"Disabling"} : \textcolor{stringliteral}{"Enabling"});}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_folder\_only\_toggle(\textcolor{keywordtype}{void}        *data,}
\DoxyCodeLine{                    \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *obj \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},}
\DoxyCodeLine{                    \textcolor{keywordtype}{void}        *event\_info \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *fs\_entry = data;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}} old\_val = \mbox{\hyperlink{group__Elm__Fileselector_ga0a195d1435ed3440fcfb0a6d799ae68e}{elm\_fileselector\_folder\_only\_get}}(fs\_entry);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Fileselector_gaeb86ea802c18c7a2f066cb4fcbe3c57e}{elm\_fileselector\_folder\_only\_set}}(fs\_entry, !old\_val);}
\DoxyCodeLine{}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"Folder only mode set to: \%s\(\backslash\)n"}, old\_val ? \textcolor{stringliteral}{"false"} : \textcolor{stringliteral}{"true"});}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_expandable\_toggle(\textcolor{keywordtype}{void}        *data,}
\DoxyCodeLine{                   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *obj \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},}
\DoxyCodeLine{                   \textcolor{keywordtype}{void}        *event\_info \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *fs\_entry = data;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}} old\_val = \mbox{\hyperlink{group__Elm__Fileselector_ga07ea4bc495413dd301a888c3413e9bd5}{elm\_fileselector\_expandable\_get}}(fs\_entry);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Fileselector_gab12cb7913e0e82ee591471a6e36b6faf}{elm\_fileselector\_expandable\_set}}(fs\_entry, !old\_val);}
\DoxyCodeLine{}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"Expandable folders mode set to: \%s\(\backslash\)n"}, old\_val ? \textcolor{stringliteral}{"false"} : \textcolor{stringliteral}{"true"});}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{EAPI\_MAIN \textcolor{keywordtype}{int}}
\DoxyCodeLine{elm\_main(\textcolor{keywordtype}{int}    argc \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},}
\DoxyCodeLine{         \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, *vbox, *hbox, *ic, *ck, *fs\_entry, *sep;}
\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_gac75d7752662fab73d6420706ce5be996}{elm\_win\_util\_standard\_add}}(\textcolor{stringliteral}{"fileselector-\/entry"}, \textcolor{stringliteral}{"File Selector Entry Example"});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Win_ga9a16a2f8c9fd5b6e9203ed9dcb53ea8b}{elm\_win\_autodel\_set}}(win, \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{}
\DoxyCodeLine{   vbox = \mbox{\hyperlink{group__Elm__Box_ga3d0998b60ada633bacfa8869a921cfd7}{elm\_box\_add}}(win);}
\DoxyCodeLine{   evas\_object\_size\_hint\_weight\_set(vbox, \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}}, \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Win_ga505d6bd217e5ee01e82b548ec35986eb}{elm\_win\_resize\_object\_add}}(win, vbox);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(vbox);}
\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}{"file"});}
\DoxyCodeLine{   evas\_object\_size\_hint\_aspect\_set(ic, \mbox{\hyperlink{Evas__Common_8h_ac68b577b7c0b79c356f01926e4a8099faeaf1e019f2dbfbbc2da9ab1fe1f175f6}{EVAS\_ASPECT\_CONTROL\_VERTICAL}}, 1, 1);}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{comment}{/* file selector entry */}}
\DoxyCodeLine{   fs\_entry = \mbox{\hyperlink{group__Elm__File__Selector__Entry_ga4f15d30896e40e7ccba49fda045ac1fe}{elm\_fileselector\_entry\_add}}(win);}
\DoxyCodeLine{   evas\_object\_size\_hint\_align\_set(fs\_entry, \mbox{\hyperlink{Evas__Common_8h_aecbac710f36d52911fc34dcdaf8e729c}{EVAS\_HINT\_FILL}}, 0);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Fileselector_ga0a29bfd628ae0dc1cc0d1a3334580802}{elm\_fileselector\_path\_set}}(fs\_entry, \textcolor{stringliteral}{"/tmp"});}
\DoxyCodeLine{   elm\_object\_text\_set(fs\_entry, \textcolor{stringliteral}{"Select a file"});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__General_ga0531ec8867c72def7c780601764ca642}{elm\_object\_part\_content\_set}}(fs\_entry, \textcolor{stringliteral}{"button icon"}, ic);}
\DoxyCodeLine{}
\DoxyCodeLine{   elm\_box\_pack\_end(vbox, fs\_entry);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(fs\_entry);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(ic);}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{comment}{/* attribute setting knobs */}}
\DoxyCodeLine{   sep = \mbox{\hyperlink{group__Elm__Separator_gabacf257db01e0b39987332c5a71096e0}{elm\_separator\_add}}(win);}
\DoxyCodeLine{   elm\_separator\_horizontal\_set(sep, \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{   elm\_box\_pack\_end(vbox, sep);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(sep);}
\DoxyCodeLine{}
\DoxyCodeLine{   hbox = \mbox{\hyperlink{group__Elm__Box_ga3d0998b60ada633bacfa8869a921cfd7}{elm\_box\_add}}(win);}
\DoxyCodeLine{   elm\_box\_horizontal\_set(hbox, \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{   elm\_box\_pack\_end(vbox, hbox);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(hbox);}
\DoxyCodeLine{}
\DoxyCodeLine{   ck = \mbox{\hyperlink{group__Elm__Check_ga252b43966ad9bbe0634c4619cac1e3e7}{elm\_check\_add}}(win);}
\DoxyCodeLine{   elm\_object\_text\_set(ck, \textcolor{stringliteral}{"editable selection"});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Check_gaa011e6d86f82142698760cf0cc4fd0a4}{elm\_check\_state\_set}}(ck, \mbox{\hyperlink{group__Elm__Fileselector_ga72f29bc1a9070aea636d95188717ee14}{elm\_fileselector\_is\_save\_get}}(fs\_entry));}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Smart__Object__Group_ga18a8b179f94d21b2b09e19db11741061}{evas\_object\_smart\_callback\_add}}(ck, \textcolor{stringliteral}{"changed"}, \_current\_sel\_toggle, fs\_entry);}
\DoxyCodeLine{   elm\_box\_pack\_end(hbox, ck);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(ck);}
\DoxyCodeLine{}
\DoxyCodeLine{   ck = \mbox{\hyperlink{group__Elm__Check_ga252b43966ad9bbe0634c4619cac1e3e7}{elm\_check\_add}}(win);}
\DoxyCodeLine{   elm\_object\_text\_set(ck, \textcolor{stringliteral}{"\(\backslash\)"inwin\(\backslash\)" mode"});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Check_gaa011e6d86f82142698760cf0cc4fd0a4}{elm\_check\_state\_set}}(ck, elm\_fileselector\_entry\_inwin\_mode\_get(fs\_entry));}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Smart__Object__Group_ga18a8b179f94d21b2b09e19db11741061}{evas\_object\_smart\_callback\_add}}(ck, \textcolor{stringliteral}{"changed"}, \_inwin\_mode\_toggle, fs\_entry);}
\DoxyCodeLine{   elm\_box\_pack\_end(hbox, ck);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(ck);}
\DoxyCodeLine{}
\DoxyCodeLine{   ck = \mbox{\hyperlink{group__Elm__Check_ga252b43966ad9bbe0634c4619cac1e3e7}{elm\_check\_add}}(win);}
\DoxyCodeLine{   elm\_object\_text\_set(ck, \textcolor{stringliteral}{"folders only"});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Check_gaa011e6d86f82142698760cf0cc4fd0a4}{elm\_check\_state\_set}}(ck, \mbox{\hyperlink{group__Elm__Fileselector_ga0a195d1435ed3440fcfb0a6d799ae68e}{elm\_fileselector\_folder\_only\_get}}(fs\_entry));}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Smart__Object__Group_ga18a8b179f94d21b2b09e19db11741061}{evas\_object\_smart\_callback\_add}}(ck, \textcolor{stringliteral}{"changed"}, \_folder\_only\_toggle, fs\_entry);}
\DoxyCodeLine{   elm\_box\_pack\_end(hbox, ck);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(ck);}
\DoxyCodeLine{}
\DoxyCodeLine{   ck = \mbox{\hyperlink{group__Elm__Check_ga252b43966ad9bbe0634c4619cac1e3e7}{elm\_check\_add}}(win);}
\DoxyCodeLine{   elm\_object\_text\_set(ck, \textcolor{stringliteral}{"expandable"});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Check_gaa011e6d86f82142698760cf0cc4fd0a4}{elm\_check\_state\_set}}(ck, \mbox{\hyperlink{group__Elm__Fileselector_ga07ea4bc495413dd301a888c3413e9bd5}{elm\_fileselector\_expandable\_get}}(fs\_entry));}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Smart__Object__Group_ga18a8b179f94d21b2b09e19db11741061}{evas\_object\_smart\_callback\_add}}(ck, \textcolor{stringliteral}{"changed"}, \_expandable\_toggle, fs\_entry);}
\DoxyCodeLine{   elm\_box\_pack\_end(hbox, ck);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(ck);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Smart__Object__Group_ga18a8b179f94d21b2b09e19db11741061}{evas\_object\_smart\_callback\_add}}(fs\_entry, \textcolor{stringliteral}{"file,chosen"}, \_file\_chosen, NULL);}
\DoxyCodeLine{}
\DoxyCodeLine{   evas\_object\_resize(win, 400, 400);}
\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}
 