/* Example of attribute mangling in mvchgat(). Compile with gcc -Wall -Wextra -pedantic -o box box.c -lncurses Run it; you get a box that says "Hit any key". Do so, and we try to set everything to be color pair 1 (green on blue). This works, but in the process, the box attributes (A_ALTCHARSET) are removed. Happens in PDCurses and ncurses. Should it? */ #include #include #include int main( void) { WINDOW *win; int i; initscr(); start_color(); noecho(); refresh( ); win = newwin( LINES / 2, COLS / 2, LINES / 4, COLS / 4); box( win, 0, 0); mvwaddstr( win, 2, 2, "Hit any key"); wrefresh( win); getch(); /* Make the window odd colors: */ init_pair( 1, COLOR_GREEN, COLOR_BLUE); for( i = 0; i < LINES / 2; i++) mvwchgat( win, i, 0, COLS / 2, 0, 1, NULL); refresh( ); wrefresh( win); getch(); /* Clean up and exit : */ delwin( win); endwin( ); return( 0); }