/* Grady Martin 2017年01月07日、22時37分 Ncurses Test Program gcc Test.c -lncursesw */ #define _XOPEN_SOURCE_EXTENDED #include #include int main (const int argc, const char * const *argv) { setlocale (LC_ALL, ""); initscr(); keypad (stdscr, TRUE); cbreak(); noecho(); curs_set (0); nonl(); refresh(); start_color(); use_default_colors(); WINDOW * p = newpad (1, 40); waddwstr (p, L"Curses is alive."); wint_t wch; // Send pad to screen and wait for key press. prefresh (p, 0, 0, 0, 0, 0, 39); get_wch (&wch); // Attempt to change attributes of the screen's first 6 characters. (Watch the characters inexplicably disappear.) Wait for key press. mvchgat (0, 0, 6, WA_UNDERLINE, 0, NULL); get_wch (&wch); endwin(); return 0; }