hscurses
Safe HaskellNone
LanguageHaskell2010

UI.HSCurses.CursesHelper

Synopsis

Documentation

start :: IO () Source #

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).

end :: IO () Source #

Clean up and go home.

suspend :: IO () Source #

Suspend the program.

resizeui :: IO (Int, Int) Source #

Resize the window From "Writing Programs with NCURSES", by Eric S. Raymond and Zeyd M. Ben-Halim

getKey :: MonadIO m => m () -> m Key Source #

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).

drawLine :: Int -> String -> IO () Source #

drawLine n s draws n characters of string s.

drawCursor :: (Int, Int) -> (Int, Int) -> IO () Source #

Draw the cursor at the given position.

gotoTop :: IO () Source #

Move cursor to origin of stdScr.

defaultColor :: Color Source #

Basic colors.

data Attribute Source #

Abstractions for some commonly used attributes.

Constructors

Bold 
Underline 
Dim 
Reverse 
Blink 

Instances

Instances details
Show Attribute Source # 
Instance details

Defined in UI.HSCurses.CursesHelper

Eq Attribute Source # 
Instance details

Defined in UI.HSCurses.CursesHelper

convertAttributes :: [Attribute] -> Attr Source #

Converts an abstract attribute list into its curses representation.

data Style Source #

A human-readable style.

Instances

Instances details
Show Style Source # 
Instance details

Defined in UI.HSCurses.CursesHelper

Methods

showsPrec :: Int -> Style -> ShowS #

show :: Style -> String #

showList :: [Style] -> ShowS #

Eq Style Source # 
Instance details

Defined in UI.HSCurses.CursesHelper

Methods

(==) :: Style -> Style -> Bool #

(/=) :: Style -> Style -> Bool #

data CursesStyle Source #

A style which uses the internal curses representations for attributes and colors.

Instances

Instances details
Show CursesStyle Source # 
Instance details

Defined in UI.HSCurses.CursesHelper

Eq CursesStyle Source # 
Instance details

Defined in UI.HSCurses.CursesHelper

changeCursesStyle :: CursesStyle -> [Attribute] -> CursesStyle Source #

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 :: (MonadIO m, MonadMask m) => CursesStyle -> m a -> m a Source #

wWithStyle :: (MonadIO m, MonadMask m) => Window -> CursesStyle -> m a -> m a Source #

displayKey :: Key -> String Source #

Converting keys to human-readable strings

withCursor :: (MonadIO m, MonadMask m) => CursorVisibility -> m a -> m a Source #

Set the cursor, and do action

withProgram :: (MonadIO m, MonadMask m) => m a -> m a Source #