OT: weird curses problem

Hannes Mayer h.mayer at inode.at
Sun Jul 3 19:55:29 CEST 2005


Hi all!

I've been sitting over this weird curses problem for the past 2 hours,
googled, but still no solution in sight.

Here is the curses init:
	initscr();
	noecho();
	cbreak();
	nodelay(stdscr, TRUE);

..make some windows:
	screen = newwin(len, width, y, x);
	box(screen, ACS_VLINE, ACS_HLINE);
	title = newwin(len - 22, width - 4, y + 1, x + 2);
	box(title, ACS_VLINE, ACS_HLINE);

..print stuff in the window
	curs_set(0);
	mvwprintw(title,1,32,"- TITLE -");

..the loop:
	while ( [condition] ) {
		current_getch = getch();
	}

Everything is printed as expected (the window-box, the TITLE), but
as soon as getch() in the while loop is reached, the window-box and
the TITLE _disappears_.
I've tried various things:
"nodelay(screen, TRUE);":  "getch" blocks.
"wgetch(stdscr)":  window-box and the TITLE vanishes.
"nodelay(screen, TRUE);" and "wgetch(screen)":  "getch" blocks

How can I keep the window-box and the mvwprintw's *without* a blocking
getch() ?

Thanks for any hints and pointers!

Best regards,
Hannes.




More information about the Rtai mailing list