ncurses

Departments

Main

About

Errata

FAQ

Compiler Tips

Supplemental Lessons

NCurses

Source Code Files

On-line Book Ordering

NCurses!

Text mode programming ain't dead yet!

Welcome to my NCurses support page, written specifically to support my book, The Programmer's Guide to NCurses, though anyone curious about NCurses is welcome.

On this page you'll find supplemental information, some bonus programs, plus the ever-popular errata.

Buy This Book!

Source Code

Supplemental Information...

Bonus Programs

Errata

Other Resources

Source Code

You asked! I finally got off my butt and did it. Here is a tar.gz file chock full of the book's source code. That's 238 files in two directories. The files in the book directory are from the chapter part of the book, named as mentioned in the book. The files in the book-ref directory are the sample files from the reference, named according to function.

Please let me know if anything is missing or wrong; my e-mail address can be found in the front of the book. Thanks!

Supplemental Information

* I've received e-mail from a fellow who's created a JavaScript binding to NCurses, implemented on top of the SpiderMonkey JavaScript engine (used by Mozilla/Firefox). By using this binding it makes it easier and faster to write NCurses apps in JavaScript, as well as having several advantages over using C. Check it out at: http://SpiderApe.sourceforge.net/

* Here's a screen map for you! It can be used to help build menus or plot coordinates on a standard 80x24 screen. PDF format.

* NCruses Colors, hues, and other information. As the book is not in color I wasn't able to include color swatches for the various NCurses color commands. But, hey! The web is in color! So here are those swatches:

Color Function Hue Constant Name
0 init_color(0,0,0,0); COLOR_BLACK
1 init_color(0,1000,0,0); COLOR_RED
2 init_color(0,0,1000,0); COLOR_GREEN
3 init_color(0,1000,1000,0); COLOR_YELLOW
4 init_color(0,0,0,1000); COLOR_BLUE
5 init_color(0,1000,0,1000); COLOR_MAGENTA
6 init_color(0,0,1000,1000); COLOR_CYAN
7 init_color(0,1000,1000,1000); COLOR_WHITE

* It is possible to get more than the standard 8 (or 16) colors out of NCurses, but you must be using a compatible terminal and re-compile NCurses on your computer to include that full color support. Read more...

* A few of the books' figures were done originally in colors. Sadly, it's not a four-color book. To see the images in their original color, lookee here.

Bonus Programs

Here is my solution for the dual-window, rot13 program at the end of Chapter 8.

Here is my solution for the clickput.c source code mentioned in Chapter 13.

The gettysburg.txt file used in a few of the sample programs for filling a window with text.

Errata

Page 20, first paragraph

The last sentence improperly spells initscr() as inistscr().

Page 104, first paragraph

There are 26 letters in the alphabet, not 36 as suggested in the text.

Page 173, Table 14-1

Oops! The double-line drawing characters are missing from the table. What a gross oversight! Here they are:

Char Dec Hex Char Dec Hex
186 0xBA 187 0xBB
205 0xCD 200 0xC8
201 0xC9 188 0xBC

Page 287

The entire getmouse() entry is not properly placed alphabetically in the appendix; it should be on page 284 or just before the getnstr() entry.

Page 352, first paragarph

Replace ROWS with LINES so that the paragraph reads:

LINES is a variable, not a constant. Note that changing the value of LINES does not re-size the standard screen or terminal window.

Page 376, second paragraph

The maximum value for ncols is 32767, the same as for nlines and as set by NCURSES_SIZE_T.

Other Resources

GNU NCurses web page - How to get NCurses, options, features, and so on.

Thomas Dickey's NCurses FAQ - General questions about NCurses itself, plus a few links to some How-Tos.