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


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