termbox 0.1.1

High level binding for Termbox.
Documentation

Termbox is a simple library for writing text based user interfaces. It was originally written in C, and this binding was not written by the original author.

Example

extern crate termbox;

use termbox::{
  Termbox,
  Event,
  BLACK,
  WHITE,
  BOLD,
  KEY_ESC,
};

fn main () {
  // Open the terminal
  let mut tb = Termbox::open().unwrap();

  // Clear the screen to black
  tb.set_clear_attributes(BLACK, BLACK);
  tb.clear();

  // Display a message
  tb.put_str(0, 0, "Hello, world!", WHITE | BOLD, BLACK);
  tb.put_str(0, 1, "Press Esc to continue", WHITE, BLACK);
  tb.present();

  // Wait for the user to press Esc
  loop {
    match tb.poll_event() {
      Event::Key(event) => {
        if event.key == KEY_ESC {
          break;
        }
      },
      _ => {},
    }
  }
}