UISF-0.4.0.0: Library for Arrowized Graphical User Interfaces.

Copyright(c) Daniel Winograd-Cort 2014
Licensesee the LICENSE file in the distribution
Maintainerdwc@cs.yale.edu
Stabilityexperimental
Safe HaskellNone
LanguageHaskell98

FRP.UISF.UISF

Contents

Description

A simple Graphical User Interface with concepts borrowed from Phooey by Conal Elliot.

Synopsis

Documentation

uisfSource :: IO b -> UISF () b Source

Lift an IO source to UISF.

uisfSink :: (a -> IO ()) -> UISF a () Source

Lift an IO sink to UISF.

uisfPipe :: (a -> IO b) -> UISF a b Source

Lift an IO pipe to UISF.

uisfSourceE :: IO b -> UISF (SEvent ()) (SEvent b) Source

Lift an IO source to an event-based 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.

getCTX :: UISF () CTX Source

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.

withCTX :: UISF (CTX, a) b -> UISF a b Source

Provide the context signal to the UISF.

getEvents :: UISF () UIEvent Source

Get the UIEvent signal from a UISF.

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.

leftRight :: UISF a b -> UISF a b Source

rightLeft :: UISF a b -> UISF a b Source

topDown :: UISF a b -> UISF a b Source

bottomUp :: UISF a b -> UISF a b Source

conjoin :: UISF a b -> UISF a b Source

unconjoin :: UISF a b -> UISF a b Source

setLayout :: Layout -> UISF a b -> UISF a b Source

Set a new layout for this widget.

setSize :: Dimension -> UISF a b -> UISF a b Source

A convenience function for setLayout, setSize sets the layout to a fixed size (in pixels).

pad :: (Int, Int, Int, Int) -> UISF a b -> UISF a b Source

Add space padding around a widget.

Execute UI Program

data UIParams Source

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.

Instances

defaultUIParams :: UIParams Source

This is the default UIParams value and what is used in runUI'.

uiInitialize :: UIParams -> IO () Source

An initialization action.

uiClose :: UIParams -> IO () Source

A termination action.

uiTitle :: UIParams -> String Source

The UI window's title.

uiSize :: UIParams -> Dimension Source

The size of the UI window.

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.

runUI :: UIParams -> UISF () () -> IO () Source

Run the UISF with the given parameters.

runUI' :: UISF () () -> IO () Source

Run the UISF with the default settings.