#include /* * Application demo */ int main() { initscr(); start_color(); clear(); cbreak(); noecho(); keypad(stdscr, TRUE); refresh(); init_pair(1, COLOR_WHITE, COLOR_BLUE); init_pair(2, COLOR_WHITE, COLOR_BLACK); wbkgd(stdscr, COLOR_PAIR(1)); wmove(stdscr, 5, 5); waddstr(stdscr, "@"); wmove(stdscr, 5, 10); waddch(stdscr, ACS_VLINE); mvwprintw(stdscr, 10, 5, "correct output (before mvwchgat)"); mvwprintw(stdscr, 11, 5, "press any key"); refresh(); getch(); mvwchgat(stdscr, 5, 5, 1, A_BOLD, 2, NULL); mvwprintw(stdscr, 10, 5, "still correct output (before mvwchgat on hline)"); mvwprintw(stdscr, 11, 5, "press any key, "); refresh(); getch(); mvwchgat(stdscr, 5, 10, 1, A_BOLD, 2, NULL); mvwprintw(stdscr, 10, 5, "hline is broken now"); mvwprintw(stdscr, 11, 5, "press any key, .. will quit "); refresh(); getch(); endwin(); return 0; }