reactive widget

This commit is contained in:
Yann Esposito (Yogsototh) 2014-12-20 22:21:39 +01:00
parent 42fd9f9927
commit 85e707ee1a

View file

@ -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)