8 /* set labels with object info */
9 get_geometry(PART:"red_rect", x, y, w, h);
10 snprintf(buf, sizeof(buf), "Timer called %d times.", val);
11 set_text(PART:"label1", buf)
12 snprintf(buf, sizeof(buf), "Object x: %d w: %d", x, w);
13 set_text(PART:"label2", buf)
16 timer(1 / 30, "timer_cb", val + 1);
22 description { state: "default" 0.0;
23 color: 255 255 255 255;
26 part { name: "label1";
28 description { state: "default" 0.0;
38 part { name: "label2";
40 description { state: "default" 0.0;
49 part { name: "red_rect";
51 description { state: "default" 0.0;
56 description { state: "default" 1.0;
57 inherit: "default" 0.0;
65 /* move the red rect back an forth in a loop */
66 program { name: "init";
69 action: STATE_SET "default" 1.0;
70 transition: SINUSOIDAL 1.0;
74 program { name: "loop";
75 action: STATE_SET "default" 0.0;
76 transition: SINUSOIDAL 1.0;
80 /* run the timer_cb for the first time */
81 program { name: "init2";