The ncurses package
GNU ncurses is a library for creating command-line application with pseudo-graphical interfaces. This package is a nice, modern binding to GNU ncurses.
The following example is a program that display the message "Hello world!" until the user hits Q:
import UI.NCurses main :: IO () main = runCurses $ do setEcho False w <- defaultWindow updateWindow w $ do moveCursor 1 10 drawString "Hello world!" moveCursor 3 10 drawString "(press q to quit)" moveCursor 0 0 render waitFor w (\ev -> ev == EventCharacter 'q' || ev == EventCharacter 'Q') waitFor :: Window -> (Event -> Bool) -> Curses () waitFor w p = loop where loop = do ev <- getEvent w Nothing case ev of Nothing -> loop Just ev' -> if p ev' then return () else loop
Properties
Modules
Downloads
- ncurses-0.2.6.tar.gz [browse] (Cabal source package)
- Package description (included in the package)
Maintainers' corner
For package maintainers and hackage trustees