on cd6407c help sign in
29 lines 835 B history raw
2module Graphics.Input where
4buttons : a -> { button : a -> String -> Element
5 , events : Signal a
6 }
8button : String -> (Element, Signal ())
9button txt =
10 let pool = buttons ()
11 in (pool.button () txt, pool.events)
13customButtons : a -> { button : a -> Element -> Element -> Element -> Element
14 , events : Signal a
15 }
17customButton : Element -> Element -> Element -> (Element, Signal ())
18customButton up hover down =
19 let pool = customButtons ()
20 in (pool.button () up hover down, pool.events)
22checkBoxes : a -> { box : (Bool -> a) -> Bool -> Element
23 , events : Signal a
24 }
26checkBox : Bool -> (Signal Element, Signal Bool)
27checkBox b =
28 let cbs = checkBoxes b
29 in (lift (cbs.box id) cbs.events, cbs.events)