\hypertarget{embryo_run_program_8edc-example}{}\doxysection{embryo\+\_\+run\+\_\+program.\+edc}
This example shows how to run an edje program from embryo code.


\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{collections \{}
\DoxyCodeLine{   group \{ name: "{}main"{};}
\DoxyCodeLine{      script \{}
\DoxyCodeLine{         public toggle;}
\DoxyCodeLine{      \}}
\DoxyCodeLine{      parts \{}
\DoxyCodeLine{         part \{ name: "{}bg"{};}
\DoxyCodeLine{            type: RECT;}
\DoxyCodeLine{            description \{ state: "{}default"{} 0.0;}
\DoxyCodeLine{               color: 255 255 255 255;}
\DoxyCodeLine{            \}}
\DoxyCodeLine{         \}}
\DoxyCodeLine{         part \{ name: "{}label"{};}
\DoxyCodeLine{            type: TEXT;}
\DoxyCodeLine{            description \{ state: "{}default"{} 0.0;}
\DoxyCodeLine{               color: 0 0 0 255;}
\DoxyCodeLine{               text \{}
\DoxyCodeLine{                  text: "{}Click me."{};}
\DoxyCodeLine{                  font: "{}Sans"{};}
\DoxyCodeLine{                  size: 12;}
\DoxyCodeLine{                  align: 0.5 0.8;}
\DoxyCodeLine{               \}}
\DoxyCodeLine{            \}}
\DoxyCodeLine{         \}}
\DoxyCodeLine{         part \{ name: "{}rect"{};}
\DoxyCodeLine{            type: RECT;}
\DoxyCodeLine{            description \{ state: "{}default"{} 0.0;}
\DoxyCodeLine{               color: 255 0 0 255;}
\DoxyCodeLine{               max: 30 30;}
\DoxyCodeLine{               align: 0.1 0.2;}
\DoxyCodeLine{            \}}
\DoxyCodeLine{            description \{ state: "{}default"{} 1.0;}
\DoxyCodeLine{               inherit: "{}default"{} 0.0;}
\DoxyCodeLine{               color: 0 0 255 255;}
\DoxyCodeLine{               align: 0.9 0.2;}
\DoxyCodeLine{            \}}
\DoxyCodeLine{         \}}
\DoxyCodeLine{      \}}
\DoxyCodeLine{      programs \{}
\DoxyCodeLine{         program \{ name: "{}go\_right"{};}
\DoxyCodeLine{            action: STATE\_SET "{}default"{} 1.0;}
\DoxyCodeLine{            transition: SINUSOIDAL 1.0;}
\DoxyCodeLine{            target: "{}rect"{};}
\DoxyCodeLine{         \}}
\DoxyCodeLine{         program \{ name: "{}go\_left"{};}
\DoxyCodeLine{            action: STATE\_SET "{}default"{} 0.0;}
\DoxyCodeLine{            transition: SINUSOIDAL 1.0;}
\DoxyCodeLine{            target: "{}rect"{};}
\DoxyCodeLine{         \}}
\DoxyCodeLine{         program \{}
\DoxyCodeLine{            signal: "{}mouse,down,1"{};}
\DoxyCodeLine{            source: "{}label"{};}
\DoxyCodeLine{            script \{}
\DoxyCodeLine{               if (get\_int(toggle) == 0) \{}
\DoxyCodeLine{                  run\_program(PROGRAM:"{}go\_right"{});}
\DoxyCodeLine{                  set\_int(toggle, 1);}
\DoxyCodeLine{               \}}
\DoxyCodeLine{               else \{}
\DoxyCodeLine{                  run\_program(PROGRAM:"{}go\_left"{});}
\DoxyCodeLine{                  set\_int(toggle, 0);}
\DoxyCodeLine{               \}}
\DoxyCodeLine{            \}}
\DoxyCodeLine{         \}}
\DoxyCodeLine{      \}}
\DoxyCodeLine{   \}}
\DoxyCodeLine{\}}

\end{DoxyCodeInclude}
 