reactive widget
This commit is contained in:
parent
42fd9f9927
commit
85e707ee1a
1 changed files with 10 additions and 3 deletions
13
Test.elm
13
Test.elm
|
@ -1,4 +1,11 @@
|
|||
import Graphics.Element (Element,container, midTop)
|
||||
import Graphics.Element (Element,container, middle,widthOf,heightOf)
|
||||
import Signal
|
||||
import Time (fps)
|
||||
import Html (..)
|
||||
main : Element
|
||||
main = container 100 100 midTop (toElement 100 100 (text "coucou"))
|
||||
|
||||
htmlToElement w h el = container w h middle (toElement w h el)
|
||||
|
||||
main : Signal Element
|
||||
main = Signal.map view (Signal.foldp (+) 0 (fps 10))
|
||||
|
||||
view t = htmlToElement 100 100 <| text ("coucou " ++ toString t)
|
||||
|
|
Loading…
Reference in a new issue