From 85e707ee1a32a5d83999d3d478257723d0b3d19f Mon Sep 17 00:00:00 2001 From: "Yann Esposito (Yogsototh)" Date: Sat, 20 Dec 2014 22:21:39 +0100 Subject: [PATCH] reactive widget --- Test.elm | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Test.elm b/Test.elm index 83e46e3..3b7dccc 100644 --- a/Test.elm +++ b/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)