- start :: IO ()
- end :: IO ()
- suspend :: IO ()
- resizeui :: IO (Int, Int)
- getKey :: MonadIO m => m () -> m Key
- drawLine :: Int -> String -> IO ()
- drawCursor :: (Int, Int) -> (Int, Int) -> IO ()
- gotoTop :: IO ()
- data ForegroundColor
- data BackgroundColor
- defaultColor :: Color
- black :: Color
- red :: Color
- green :: Color
- yellow :: Color
- blue :: Color
- magenta :: Color
- cyan :: Color
- white :: Color
- data Attribute
- convertAttributes :: [Attribute] -> Attr
- data Style
- data CursesStyle
- mkCursesStyle :: [Attribute] -> CursesStyle
- changeCursesStyle :: CursesStyle -> [Attribute] -> CursesStyle
- setStyle :: CursesStyle -> IO ()
- resetStyle :: IO ()
- convertStyles :: [Style] -> IO [CursesStyle]
- defaultStyle :: Style
- defaultCursesStyle :: CursesStyle
- withStyle :: MonadExcIO m => CursesStyle -> m a -> m a
- displayKey :: Key -> String
- withCursor :: MonadExcIO m => CursorVisibility -> m a -> m a
- withProgram :: MonadExcIO m => m a -> m a
UI initialisation
start
initializes the UI and grabs the keyboard.
This function installs a handler for the SIGWINCH signal which writes the KEY_RESIZE key to the input queue (if KEY_RESIZE and and SIGWINCH are both available).
resizeui :: IO (Int, Int)Source
Resize the window From Writing Programs with NCURSES, by Eric S. Raymond and Zeyd M. Ben-Halim
Input
getKey :: MonadIO m => m () -> m KeySource
getKey refresh
reads a key.
The refresh
function is used to redraw the screen when the terminal size
changes (see the documentatio of start
for a discussion of the problem).
Drawing
Navigation
Colors
data ForegroundColor Source
Foreground colors.
data BackgroundColor Source
Background colors.
Basic colors.
Attributes
Abstractions for some commonly used attributes.
convertAttributes :: [Attribute] -> AttrSource
Converts an abstract attribute list into its curses representation.
Style
A humand-readable style.
data CursesStyle Source
A style which uses the internal curses representations for attributes and colors.
mkCursesStyle :: [Attribute] -> CursesStyleSource
changeCursesStyle :: CursesStyle -> [Attribute] -> CursesStyleSource
Changes the attributes of the given CursesStyle.
setStyle :: CursesStyle -> IO ()Source
Manipulate the current style of the standard screen
resetStyle :: IO ()Source
Reset the screen to normal values
convertStyles :: [Style] -> IO [CursesStyle]Source
Converts a list of human-readable styles into the corresponding curses representation.
This function should be called exactly once at application startup for all styles of the application.
withStyle :: MonadExcIO m => CursesStyle -> m a -> m aSource
Keys
displayKey :: Key -> StringSource
Converting keys to humand-readable strings
Helpers
withCursor :: MonadExcIO m => CursorVisibility -> m a -> m aSource
Other helpers
set the cursor, and do action
withProgram :: MonadExcIO m => m a -> m aSource