Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
6581 | leency | 1 | -- |
2 | -- test of GUI library |
||
3 | -- |
||
4 | run("libs/gui.lua") |
||
5 | |||
6 | local counter = gui.label{x=10, y=54, value=0, format="% .3d"} |
||
7 | local form = gui.dialog{ |
||
8 | title="Dialogtest", |
||
9 | w=100, |
||
10 | h=150, |
||
11 | counter, |
||
12 | gui.button{ label="+", |
||
13 | x=6, y=38, w=14, h=14, repeatable=true, click=function() |
||
14 | counter.value=counter.value+1; |
||
15 | counter:render(); |
||
16 | end}, |
||
17 | gui.button{ label="-", |
||
18 | x=26, y=38, w=14, h=14, repeatable=true, click=function() |
||
19 | counter.value=counter.value-1; |
||
20 | counter:render(); |
||
21 | end}, |
||
22 | gui.button{ label="Help", |
||
23 | x=6, y=70, w=54, h=14, click=function() |
||
24 | messagebox("Help screen"); |
||
25 | end}, |
||
26 | gui.button{ label="Close", |
||
27 | x=6, y=18, w=54, h=14, key=27, click=function() |
||
28 | return true; -- causes closing |
||
29 | end}, |
||
30 | } |
||
31 | |||
32 | form:run() |
||
33 |