Curses full-screen package for C programmers ================================================================================ Include the following in your C source code: #include To compile: cc myprog.c -lcurses -ltermlib The main structure: void main() { initscr(); /* start Curses */ ... /* all other stuff */ endwin(); /* end Curses */ } DO NOT USE STANDARD INPUT AND OUTPUT FUNCTIONS! The following should never be used while in curses because they will cause unpredictable results; gets(), puts(), getchar(), putchar(), printf(), scanf() <-- BAD :-( You can still use the string and file versions, however, like fgets(), fputs(), fgetc(), fputc(), fprintf(), fscanf() <-- OKAY :-) sprintf(), sscanf() Instead, use the following: ch = getch() /* get 1 character */ getstr(line) /* get a string and put into "line" */ addch('*') /* overwrite character at current position */ insch('*') /* insert character, pushing others to right */ addstr("hi there world") /* overwrite character string at current pos */ No changes take place on your screen until you do refresh() You can move the current position by move(Y,X) such as move(15,45) The screen is set up using the following grid coordinates: 0,0 ----------------------increasing X--------------------------> | | | increasing Y | | | v To erase everything on the screen clear() To start putting out characters in reverse video, and then to return to normal mode: standout(); ... standend(); If you want to get immediate input, switch to cbreak mode, and usually turn off echo: cbreak(); noecho(); To switch back to regular mode: nocbreak(); echo();