summaryrefslogtreecommitdiff
path: root/legacy/edje/doc
diff options
context:
space:
mode:
authorDavide Andreoli <dave@gurumeditation.it>2010-10-07 18:34:40 +0000
committerDavide Andreoli <dave@gurumeditation.it>2010-10-07 18:34:40 +0000
commit57af52806272c9e7ff126e2210be0a336ebf4eb3 (patch)
treeee255cf9e3d236a58b02835a5c92bbf5229b88de /legacy/edje/doc
parent631aa5454568d08c81d6779a2cb1a72f7a189e14 (diff)
Add a new embryo example to edje, it show the usage of program_run() and toggle buttons.
SVN revision: 53149
Diffstat (limited to 'legacy/edje/doc')
-rw-r--r--legacy/edje/doc/examples/embryo_run_program.edc66
1 files changed, 66 insertions, 0 deletions
diff --git a/legacy/edje/doc/examples/embryo_run_program.edc b/legacy/edje/doc/examples/embryo_run_program.edc
new file mode 100644
index 0000000000..4833b930ee
--- /dev/null
+++ b/legacy/edje/doc/examples/embryo_run_program.edc
@@ -0,0 +1,66 @@
1collections {
2 group { name: "main";
3 script {
4 public toggle;
5 }
6 parts {
7 part { name: "bg";
8 type: RECT;
9 description { state: "default" 0.0;
10 color: 255 255 255 255;
11 }
12 }
13 part { name: "label";
14 type: TEXT;
15 description { state: "default" 0.0;
16 color: 0 0 0 255;
17 text {
18 text: "Click me.";
19 font: "Sans";
20 size: 12;
21 align: 0.5 0.8;
22 }
23 }
24 }
25 part { name: "rect";
26 type: RECT;
27 description { state: "default" 0.0;
28 color: 255 0 0 255;
29 max: 30 30;
30 align: 0.1 0.2;
31 }
32 description { state: "default" 1.0;
33 inherit: "default" 0.0;
34 color: 0 0 255 255;
35 align: 0.9 0.2;
36 }
37 }
38 }
39 programs {
40 program { name: "go_right";
41 action: STATE_SET "default" 1.0;
42 transition: SINUSOIDAL 1.0;
43 target: "rect";
44 }
45 program { name: "go_left";
46 action: STATE_SET "default" 0.0;
47 transition: SINUSOIDAL 1.0;
48 target: "rect";
49 }
50 program {
51 signal: "mouse,down,1";
52 source: "label";
53 script {
54 if (get_int(toggle) == 0) {
55 run_program(PROGRAM:"go_right");
56 set_int(toggle, 1);
57 }
58 else {
59 run_program(PROGRAM:"go_left");
60 set_int(toggle, 0);
61 }
62 }
63 }
64 }
65 }
66}