#include <ncurses.h>
/* 사용 가능한 폰트의 속성 필드 ====================================== A_NORMAL Normal display (no highlight) A_STANDOUT Best highlighting mode of the terminal. A_UNDERLINE Underlining A_REVERSE Reverse video A_BLINK Blinking A_DIM Half bright A_BOLD Extra bright or bold A_PROTECT Protected mode A_INVIS Invisible or blank mode A_ALTCHARSET Alternate character set A_CHARTEXT Bit.mask to extract a character COLOR_PAIR(n) Color.pair number n */
// // Ncurse 출력 속성 // int main(void) { int y, x; char c= 'V'; int atts;
initscr();
/* set default init mode */ noecho(); raw();
// sector #01 addch(c|A_BOLD);
// sector #02 atts= A_BLINK|A_BOLD; attrset(atts); // 속성 세팅 '볼드체' move(3, 0); addstr("hello, world");
// sector #03 attroff(atts); // 속성 변경 'OFF' move(4, 0); addstr("hello, world");
// sector #04 attron(atts); // 속성 변경 'ON' move(5, 0); addstr("hello, world");
// sector #05 attrset(A_UNDERLINE); // 속성 세팅 '밑줄' move(6, 0); addstr("hello, world");
// sector #06 attrset(A_NORMAL); // 속성 '보통체' move(8, 0); printw("Life is life(A_NORMAL)\n");
attrset(A_STANDOUT); // 속성 '강조' printw("Life is life(A_STANDOUT)\n");
attrset(A_REVERSE); // 속성 '역상' printw("Life is life(A_REVERSE)\n");
attrset(A_BLINK); // 속성 '깜빡임' printw("Life is life(A_BLINK)\n");
attrset(A_DIM); // 속성 '연한밝기' printw("Life is life(A_DIM)\n");
attrset(A_BOLD); // 속성 '볼드체' printw("Life is life(A_BOLD)\n");
attrset(A_UNDERLINE); // 속성 '밑줄' printw("Life is life(A_UNDERLINE)\n\n");
refresh();
attrset(A_BOLD); getmaxyx(stdscr,y,x); mvprintw(y-1,0,"%s","Enter the any button to continue!"); getch();
// sector #07 move(8,0); chgat(-1, A_REVERSE, 0, NULL);
mvprintw(y-1,0,"%s","Enter the any button to exit! "); getch();
endwin(); return 0; }
/* 03_attr.c */
|