#!/usr/bin/perl -w # 1999-06 # http://www.cyut.edu.tw/~ckhung/b/mi/ use Curses; initscr; attrset(A_BOLD); addstr(0, 0, "bold (粗體)"); attrset(A_UNDERLINE); addstr(1, 0, "underline (底線)"); attrset(A_BLINK); addstr(2, 0, "blink (閃爍)"); attrset(A_REVERSE); addstr(3, 0, "reverse (反白)"); attrset(A_NORMAL); if (has_colors()) { addstr(5, 0, "terminal supports color"); } else { addstr(5, 0, "terminal does not support color"); } start_color; init_pair(1, COLOR_CYAN, COLOR_RED); attrset(COLOR_PAIR(1)); addstr(7, 0, "cyan on red (青字紅底)"); attrset(A_BOLD | A_UNDERLINE | A_BLINK | A_REVERSE | COLOR_PAIR(1)); addstr(8, 0, "everything (上述全部)"); attrset(A_NORMAL); cbreak; noecho; getch; endwin;