Copyright | (c) Daniel Winograd-Cort 2014 |
---|---|
License | see the LICENSE file in the distribution |
Maintainer | dwc@cs.yale.edu |
Stability | experimental |
Safe Haskell | None |
Language | Haskell98 |
A simple Graphical User Interface with concepts borrowed from Phooey by Conal Elliot.
- data UISF b c = UISF {}
- uisfSource :: IO b -> UISF () b
- uisfSink :: (a -> IO ()) -> UISF a ()
- uisfPipe :: (a -> IO b) -> UISF a b
- uisfSourceE :: IO b -> UISF (SEvent ()) (SEvent b)
- uisfSinkE :: (a -> IO ()) -> UISF (SEvent a) (SEvent ())
- uisfPipeE :: (a -> IO b) -> UISF (SEvent a) (SEvent b)
- getDeltaTime :: UISF b DeltaT
- getCTX :: UISF () CTX
- withCTX :: UISF (CTX, a) b -> UISF a b
- getEvents :: UISF () UIEvent
- getFocusData :: UISF () Focus
- addTerminationProc :: IO () -> UISF a a
- getMousePosition :: UISF () Point
- mkUISF :: Layout -> ((CTX, Focus, DeltaT, UIEvent, a) -> (DirtyBit, Focus, Graphic, TerminationProc, b)) -> UISF a b
- leftRight :: UISF a b -> UISF a b
- rightLeft :: UISF a b -> UISF a b
- topDown :: UISF a b -> UISF a b
- bottomUp :: UISF a b -> UISF a b
- conjoin :: UISF a b -> UISF a b
- unconjoin :: UISF a b -> UISF a b
- setLayout :: Layout -> UISF a b -> UISF a b
- setSize :: Dimension -> UISF a b -> UISF a b
- pad :: (Int, Int, Int, Int) -> UISF a b -> UISF a b
- data UIParams
- defaultUIParams :: UIParams
- uiInitialize :: UIParams -> IO ()
- uiClose :: UIParams -> IO ()
- uiTitle :: UIParams -> String
- uiSize :: UIParams -> Dimension
- uiInitFlow :: UIParams -> Flow
- uiTickDelay :: UIParams -> DeltaT
- uiCloseOnEsc :: UIParams -> Bool
- uiBackground :: UIParams -> RGB
- runUI :: UIParams -> UISF () () -> IO ()
- runUI' :: UISF () () -> IO ()
Documentation
uisfSource :: IO b -> UISF () b Source
Lift an IO source to UISF.
uisfSinkE :: (a -> IO ()) -> UISF (SEvent a) (SEvent ()) Source
Lift an IO sink to an event-based UISF.
uisfPipeE :: (a -> IO b) -> UISF (SEvent a) (SEvent b) Source
Lift an IO pipe to an event-based UISF.
UISF Getters
getDeltaTime :: UISF b DeltaT Source
Get the time signal from a UISF.
Deprecated: As of UISF-0.4.0.0, use withCTX instead
Get the context signal from a UISF. This has been deprecated in favor of withCTX as it can provide misleading information.
getFocusData :: UISF () Focus Source
Get the focus data from a UISF.
addTerminationProc :: IO () -> UISF a a Source
Add a termination procedure to a UISF.
getMousePosition :: UISF () Point Source
Get the mouse position from a UISF.
UISF constructors, transformers, and converters
mkUISF :: Layout -> ((CTX, Focus, DeltaT, UIEvent, a) -> (DirtyBit, Focus, Graphic, TerminationProc, b)) -> UISF a b Source
This function creates a UISF with the given parameters.
Layout Transformers
These functions are UISF transformers that modify the context.
setSize :: Dimension -> UISF a b -> UISF a b Source
A convenience function for setLayout, setSize sets the layout to a fixed size (in pixels).
Execute UI Program
The UIParams data type provides an interface for modifying some of the settings for runUI without forcing runUI to take a zillion arguments. Typical usage will be to modify the below defaultUIParams using record syntax.
defaultUIParams :: UIParams Source
This is the default UIParams value and what is used in runUI'.
uiInitialize :: UIParams -> IO () Source
An initialization action.
uiInitFlow :: UIParams -> Flow Source
The initial Flow setting.
uiTickDelay :: UIParams -> DeltaT Source
How long the UI will sleep between clock ticks if no events are detected. This should be probably be set to O(milliseconds), but it can be set to 0 for better performance (but also higher CPU usage)
uiCloseOnEsc :: UIParams -> Bool Source
Should the UI window close when the user presses the escape key?
uiBackground :: UIParams -> RGB Source
The default color of the UI window background.