Popularity
1.9
Growing
Activity
0.0
Stable
2
2
1

Monthly Downloads: 15
Programming language: Haskell
License: BSD 3-clause "New" or "Revised" License
Tags: Text    

termbox-bindings alternatives and similar packages

Based on the "Text" category.
Alternatively, view termbox-bindings alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of termbox-bindings or a related project?

Add another 'Text' Package

README

A very thin wrapper around [Termbox](github.com/nsf/termbox).

Got the idea to do this from [Rustbox](github.com/gchp/rustbox), as you can probably tell from the following example.

Example

An excerpt from Example.hs.

import Termbox
import Termbox.Enums
import Termbox.Modes

main :: IO ()
main = do
    (Right _) <- tbInit
    tbSelectInputMode inputMode { isEsc = True, isMouse = True }
    puts 1 1 White Black "Hello, world!"
    puts 1 3 White Black "Press 'q' to quit."
    tbPresent
    loop
    tbShutdown
  where
    loop = do
      e <- tbPollEvent
      puts 1 8 Magenta Black (show e) >> tbPresent
      case e of
        Right (KeyEvent _ _ 113) -> return ()
        _                        -> loop

Build

Get [Termbox](github.com/nsf/termbox).

$ git clone github.com/nsf/termbox .termbox

Build it.

$ cd termbox
$ ./waf configure --prefix=/usr
$ ./waf
$ ./waf install --targets=termbox_static --destdir=.termbox/dist

Now we're ready to build the bindings.

$ cabal configure --extra-include-dir=.termbox/src --extra-lib-dir=`pwd`/.termbox/dist/lib
$ cabal build

And run the example.

$ DYLD_LIBRARY_PATH=.termbox/dist/lib dist/build/example/example