dialog timer {
title "Timer"
size -1 -1 68 47
option dbu
text "Current:", 3, 7 20 25 8
text "End Time:", 4, 7 32 25 8
box "", 5, 3 0 62 44
edit "", 6, 34 19 27 10, center
edit "", 7, 34 31 27 10, center
button "Start!", 8, 7 7 25 10
button "Stop!", 9, 34 7 27 10
}
alias trip {
if ($dialog(timer)) {
return $asctime($calc($ctime - %ts),nn:ss)
}
}
alias crono { dialog -md timer timer }
on *:DIALOG:timer:sclick:8:{
%ts = $ctime
if ($dialog(timer)) {
/.timer 20000 1 //did -ra $dname 6 $!trip
}
}
on *:DIALOG:timer:sclick:9:{
/.timers off
did -ra $dname 7 $did($dname,6).text
}
on *:DIALOG:timer:close:0:{
/.timers off
}