\section{radio\-\_\-example\-\_\-01.\-c}

\begin{DoxyCodeInclude}
\textcolor{comment}{//Compile with:}
\textcolor{comment}{//gcc -g radio\_example\_01.c -o radio\_example\_01 `pkg-config --cflags --libs elementary`}

\textcolor{preprocessor}{#include <Elementary.h>}

\textcolor{keyword}{static} \textcolor{keywordtype}{int} val = 1;

\textcolor{keyword}{static} \textcolor{keywordtype}{void} \_cb(\textcolor{keywordtype}{void} *data, Evas\_Object *obj, \textcolor{keywordtype}{void} *event\_info);

EAPI\_MAIN \textcolor{keywordtype}{int}
elm\_main(\textcolor{keywordtype}{int} argc, \textcolor{keywordtype}{char} **argv)
\{
   Evas\_Object *win, *bx, *radio, *group, *ic;

   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

   win = elm_win_util_standard_add(\textcolor{stringliteral}{"radio"}, \textcolor{stringliteral}{"Radio"});
   elm_win_autodel_set(win, EINA\_TRUE);

   bx = elm_box_add(win);
   elm_box_horizontal_set(bx, EINA\_TRUE);
   evas\_object\_size\_hint\_weight\_set(bx, EVAS\_HINT\_EXPAND, EVAS\_HINT\_EXPAND);
   elm_win_resize_object_add(win, bx);
   evas\_object\_show(bx);

   group = radio = elm_radio_add(win);
   elm\_object\_text\_set(radio, \textcolor{stringliteral}{"Radio 1"});
   elm_radio_state_value_set(radio, 1);
   elm_radio_value_pointer_set(radio, &val);
   ic = elm_icon_add(win);
   elm_icon_standard_set(ic, \textcolor{stringliteral}{"home"});
   elm_object_part_content_set(radio, \textcolor{stringliteral}{"icon"}, ic);
   elm_box_pack_end(bx, radio);
   evas\_object\_size\_hint\_weight\_set(radio, EVAS\_HINT\_EXPAND, EVAS\_HINT\_EXPAND);
   evas\_object\_size\_hint\_align\_set(radio, EVAS\_HINT\_FILL, EVAS\_HINT\_FILL);
   evas\_object\_show(radio);
   evas\_object\_smart\_callback\_add(radio, \textcolor{stringliteral}{"changed"}, \_cb, NULL);

   radio = elm_radio_add(win);
   elm\_object\_text\_set(radio, \textcolor{stringliteral}{"Radio 2"});
   elm_radio_state_value_set(radio, 2);
   elm_radio_value_pointer_set(radio, &val);
   elm_radio_group_add(radio, group);
   ic = elm_icon_add(win);
   elm_icon_standard_set(ic, \textcolor{stringliteral}{"file"});
   elm_object_part_content_set(radio, \textcolor{stringliteral}{"icon"}, ic);
   elm_box_pack_end(bx, radio);
   evas\_object\_size\_hint\_weight\_set(radio, EVAS\_HINT\_EXPAND, EVAS\_HINT\_EXPAND);
   evas\_object\_size\_hint\_align\_set(radio, EVAS\_HINT\_FILL, EVAS\_HINT\_FILL);
   evas\_object\_show(radio);
   evas\_object\_smart\_callback\_add(radio, \textcolor{stringliteral}{"changed"}, \_cb, NULL);

   radio = elm_radio_add(win);
   elm\_object\_text\_set(radio, \textcolor{stringliteral}{"Radio 3"});
   elm_radio_state_value_set(radio, 3);
   elm_radio_value_pointer_set(radio, &val);
   elm_radio_group_add(radio, group);
   elm_box_pack_end(bx, radio);
   evas\_object\_size\_hint\_weight\_set(radio, EVAS\_HINT\_EXPAND, EVAS\_HINT\_EXPAND);
   evas\_object\_size\_hint\_align\_set(radio, EVAS\_HINT\_FILL, EVAS\_HINT\_FILL);
   evas\_object\_show(radio);
   evas\_object\_smart\_callback\_add(radio, \textcolor{stringliteral}{"changed"}, \_cb, NULL);

   radio = elm_radio_add(win);
   elm\_object\_text\_set(radio, \textcolor{stringliteral}{"Radio 4"});
   elm_radio_state_value_set(radio, 4);
   elm_box_pack_end(bx, radio);
   evas\_object\_size\_hint\_weight\_set(radio, EVAS\_HINT\_EXPAND, EVAS\_HINT\_EXPAND);
   evas\_object\_size\_hint\_align\_set(radio, EVAS\_HINT\_FILL, EVAS\_HINT\_FILL);
   evas\_object\_show(radio);

   evas\_object\_show(win);

   elm_run();
   elm_shutdown();

   \textcolor{keywordflow}{return} 0;
\}
ELM_MAIN()

static \textcolor{keywordtype}{void}
\_cb(\textcolor{keywordtype}{void} *data, Evas\_Object *obj, \textcolor{keywordtype}{void} *event\_info)
\{
   printf(\textcolor{stringliteral}{"val is now: %d\(\backslash\)n"}, val);
\}
\end{DoxyCodeInclude}
 