\hypertarget{embryo_set_state_8edc-example}{}\section{embryo\+\_\+set\+\_\+state.\+edc}
This example shows how to change the state of a part from embryo code.


\begin{DoxyCodeInclude}
1 collections \{
2    group \{ name: "main";
3       parts \{
4          part \{ name: "bg";
5             type: RECT;
6             description \{ state: "default" 0.0;
7                color: 255 255 255 255;
8             \}
9          \}
10          part \{ name: "label";
11             type: TEXT;
12             description \{ state: "default" 0.0;
13                color: 0 0 0 255;
14                text \{
15                   text: "Click me.";
16                   font: "Sans";
17                   size: 12;
18                   align: 0.0 0.7;
19                \}
20             \}
21          \}
22          part \{ name: "red\_rect";
23             type: RECT;
24             description \{ state: "default" 0.0;
25                color: 255 0 0 255;
26                max: 30 30;
27                align: 0.1 0.2;
28             \}
29             description \{ state: "default" 1.0;
30                inherit: "default" 0.0;
31                color: 0 0 255 255;
32                align: 0.9 0.2;
33             \}
34          \}
35       \}
36       programs \{
37          program \{
38             signal: "mouse,down,1";
39             source: "label";
40             script \{
41                set\_state(PART:"red\_rect", "default", 1.0);
42             \}
43          \}
44       \}
45    \}
46 \}
\end{DoxyCodeInclude}
 