#include #include #include // gcc -I/usr/include/ncursesw/ -D_XOPEN_SOURCE_EXTENDED bkgd_test.c -lncursesw int main() { WINDOW *win1, *win2; int ret; setlocale(LC_ALL,""); initscr(); cbreak(); noecho(); halfdelay(100); //display value of constants printw("FALSE %d\n", FALSE ); printw("TRUE %d\n", TRUE ); printw("false %d\n", false ); printw("true %d\n", true ); printw("OK %d\n", OK ); printw("ERR %d\n", ERR ); //test return value of bkgd() printw("bkgdset( 'w' | COLOR_PAIR(2) ) \n"); bkgdset( 'w' | COLOR_PAIR(2) ); printw("bkgd( 'b' | A_UNDERLINE ) %d\n", bkgd( 'b' | A_UNDERLINE ) ); //正常 ret=0 : OK refresh(); getch(); //test return value of wbkgd() printw("win1=newwin(5,6,7,8) %d\n", win1=newwin(5,6,7,8) ); printw("wbkgdset(win1, 'W' | COLOR_PAIR(3) ) \n"); wbkgdset(win1, 'W' | COLOR_PAIR(3) ); printw("wbkgd(win1, 'B' | A_REVERSE ) %d\n", wbkgd(win1, 'B' | A_REVERSE ) ); //正常 ret=0 : OK printw("wbkgd(NULL, 'N' | A_BOLD ) %d\n", wbkgd(NULL, 'N' | A_BOLD ) ); //ヌル ret=-1 : ERR refresh(); wrefresh(win1); getch(); endwin(); return(0); }