view finch/libgnt/test/key.c @ 21720:ea56d9386081

Restore the screen properly after the child process ends.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sun, 02 Dec 2007 06:01:52 +0000
parents f104e1d45d85
children
line wrap: on
line source

#include <ncurses.h>

int main()
{
	int ch;

	initscr();
	noecho();
	cbreak();
	refresh();

	WINDOW *win = newpad(20, 30);
	box(win, 0, 0);
	prefresh(win, 0, 0, 0, 0, 19, 29);
	doupdate();

	while ((ch = getch())) {
		printw("%d ", ch);
		refresh();
	}

	endwin();
	return 0;
}