phooey-2.0: Functional user interfacesSource codeContentsIndex
Graphics.UI.Phooey.Applicative
PortabilityTypeSynonymInstances
Stabilityexperimental
Maintainerconal@conal.net
Contents
The UI applicative functor
Tools for high-level widgets
Some high-level widgets
Explicit layout
Description
UIs as applicative functors. This module is a very simple layering over Graphics.UI.Phooey.Monad. It serves to hide the Source types and give an applicative feel to UI construction.
Synopsis
type UI = UI :. Source
runUI :: UI Action -> IO ()
runNamedUI :: String -> UI Action -> IO ()
type IWidget a = a -> UI a
type OWidget a = UI (Sink a)
iwidget :: IWidget a -> IWidget a
owidget :: OWidget' a -> OWidget a
stringEntry :: IWidget String
stringDisplay :: OWidget String
showDisplay :: Show a => OWidget a
islider :: (Int, Int) -> IWidget Int
isliderDisplay :: (Int, Int) -> OWidget Int
fslider :: RealFrac a => (a, a) -> IWidget a
fsliderDisplay :: RealFrac a => (a, a) -> OWidget a
checkBoxEntry :: IWidget Bool
checkBoxDisplay :: OWidget Bool
choices :: [String] -> IWidget String
timedPoll :: Double -> IO a -> UI a
fromTop :: Unop (UI a)
fromBottom :: Unop (UI a)
fromLeft :: Unop (UI a)
fromRight :: Unop (UI a)
The UI applicative functor
type UI = UI :. SourceSource
The UI applicative functor.
runUI :: UI Action -> IO ()Source
Run a UI with window title "Applicative Phooey GUI".
runNamedUI :: String -> UI Action -> IO ()Source
Run a UI with given window title.
Tools for high-level widgets
type IWidget a = a -> UI aSource
Input widget, with initial value.
type OWidget a = UI (Sink a)Source
Output widget. Yields a sink of values
iwidget :: IWidget a -> IWidget aSource
Make an input widget
owidget :: OWidget' a -> OWidget aSource
Make an output widget
Some high-level widgets
stringEntry :: IWidget StringSource
String input widget
stringDisplay :: OWidget StringSource
String display widget
showDisplay :: Show a => OWidget aSource
Showable output widget
islider :: (Int, Int) -> IWidget IntSource
Slider input widget
isliderDisplay :: (Int, Int) -> OWidget IntSource
Slider output widget with static bounds
fslider :: RealFrac a => (a, a) -> IWidget aSource
Slider input widget over fractional values
fsliderDisplay :: RealFrac a => (a, a) -> OWidget aSource
Slider input widget over fractional values
checkBoxEntry :: IWidget BoolSource
Boolean input widget
checkBoxDisplay :: OWidget BoolSource
Boolean display widget
choices :: [String] -> IWidget StringSource
Input from a "menu" of choices.
timedPoll :: Double -> IO a -> UI aSource
Input from a timer and a means of polling. Interval is in seconds. If poll is expensive, then apply cache to the resulting UI.
Explicit layout
fromTop :: Unop (UI a)Source
Lay out from top to bottom
fromBottom :: Unop (UI a)Source
Lay out from bottom to top
fromLeft :: Unop (UI a)Source
Lay out from left to right
fromRight :: Unop (UI a)Source
Lay out from right to left
Produced by Haddock version 2.1.0