A safe ncurses wrapper for Rust
Clone or download
jeaye Merge pull request #179 from opitykubusiem/fix/unused-macros
Deleted unused mouse event macros
Latest commit 8e97504 Jan 8, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples put wide character example behind cfg Jun 25, 2018
src Deleted unused macros Jan 8, 2019
.gitignore removed swap files from repo Nov 27, 2016
.travis.yml use travis CI's rust support Jun 25, 2018
Cargo.toml Bump version Dec 23, 2018
LICENSE Update license (still MIT) Jan 11, 2016
Makefile fix build for rustc nightly Jan 24, 2015
README.md Update README.md Nov 28, 2018
build.rs Use environment variables Nov 28, 2018

README.md

ncurses-rs Build Status

This is a very thin wrapper around the ncurses TUI lib.

Building

The compiled library will go to the target directory.

cargo build

Note that you must to have the ncurses library installed and linkable for ncurses-rs to work. On Linux, this should be trivial. On OS X, consider installing ncurses using Homebrew. (Note that you have to force Homebrew to link the library to /usr/local/lib: brew link --force ncurses and set that path to LIBRARY_PATH environmental variable.)

Examples

Examples are built by cargo build. To run them, use cargo run --example ex_<NUMBER>. Example numbers increase along with the complexity of the example.

Current examples:
1. Hello World
2. Basic Input & Attributes
3. Simple Pager
4. Window Movement
5. Menu Library (requires rust nightly)
6. Pager & Syntax Highlighting
7. Basic Input & Attributes (Unicode)
8. Special ACS Characters

Environment variables

Some environment variables are read by build.rs:

If set, NCURSES_RS_RUSTC_LINK_LIB will be used for NCURSES_RS_RUSTC_LINK_LIB.

If set, NCURSES_RS_RUSTC_FLAGS will be used for cargo:rustc-flags.

If set, NCURSES_RS_CFLAGS will be used for the compilation of the test program chtype_size.c.