28 lines
629 B
Plaintext
28 lines
629 B
Plaintext
nomainwin
|
|
stylebits #demo.val, _ES_NUMBER, 0, 0, 0
|
|
textbox #demo.val, 20, 50, 90, 24
|
|
button #demo.inc, "Increment", [btnIncrement], UL, 20, 90, 90, 24
|
|
button #demo.rnd, "Random", [btnRandom], UL, 20, 120, 90, 24
|
|
open "Rosetta Task: GUI component interaction" for window as #demo
|
|
#demo "trapclose [quit]"
|
|
#demo.val 0
|
|
wait
|
|
|
|
[quit]
|
|
close #demo
|
|
end
|
|
|
|
[btnIncrement]
|
|
#demo.val "!contents? nVal"
|
|
nVal = nVal + 1
|
|
#demo.val nVal
|
|
wait
|
|
|
|
[btnRandom]
|
|
confirm "Reset value to random number";yn$
|
|
if yn$ = "yes" then
|
|
nVal = int(rnd(1) * 100) + 1
|
|
#demo.val nVal
|
|
end if
|
|
wait
|