forked from KaruroChori/vs-fltk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo-c.xml
39 lines (34 loc) · 1.1 KB
/
demo-c.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?xml version="1.0" encoding="UTF-8"?>
<app xmlns:fl="vs.fltk">
<fl:window box="0,0,320,240" label="Demo Counter (C)">
<mixin name="+fl:button" bg.colour="#aa3300" label.colour="#99ee4f" />
<script lang="c">
<![CDATA[
unsigned int counter = 0;
void _update(){
static char str_buf[32];
itoa(counter,str_buf,10);
$$prop($("main-text"),"label",str_buf);
}
void on_add(){
counter++;
_update();
}
void on_dec(){
counter--;
_update();
}
$cb(on_add);
$cb(on_dec);
]]>
</script>
<fl:label name="main-text" label="0" label.size="90" box="20,20,280,120" />
<fl:button label="Add" on.callback="on_add" box="20,160,80,50" />
<fl:button label="Remove" on.callback="on_dec" box="120,160,80,50" />
<fl:button label="Console" box="220,160,80,50">
<script lang="c" compact="true">
$log(LOG_LOG,"Hello world!");
</script>
</fl:button>
</fl:window>
</app>