Mercurial > gui
annotate examples/countdown.ur @ 21:30f9a763f5fb
Tweak TogglePanel signature
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Sat, 24 Sep 2011 17:35:33 -0400 |
parents | 2947170fcfd6 |
children |
rev | line source |
---|---|
adam@17 | 1 fun main () : transaction page = |
adam@17 | 2 start <- now; |
adam@17 | 3 deadline <- return (addSeconds start 60); |
adam@17 | 4 cl <- Clock.create 500; |
adam@17 | 5 return <xml><body onload={Clock.start cl}> |
adam@17 | 6 <dyn signal={cl <- Clock.signal cl; |
adam@17 | 7 return <xml> |
adam@17 | 8 {[cl]}<br/> |
adam@17 | 9 {if cl > deadline then |
adam@17 | 10 <xml><b>Expired</b></xml> |
adam@17 | 11 else |
adam@17 | 12 <xml>{[diffInSeconds cl deadline]}</xml>} |
adam@17 | 13 </xml>}/> |
adam@17 | 14 </body></xml> |