編譯需鏈接 -lncurses,頭文件 <curses.h>。Fedora 安裝:yum install ncurses-devel。
initscr() / endwin()addch(), addchstr(), printw(), refresh()(必須調用刷新物理屏)inch(), instr()erase(), clear(), clrtobot(), clrtoeol()move(y,x), leaveok()attron/attroff/attrset(), standout/standend(), A_BOLD, A_UNDERLINE, A_REVERSEecho/noecho(), cbreak/nocbreak(), raw/noraw()getch(), getstr(), getnstr(), scanw()newwin(lines,cols,y,x), delwin()w(窗口)、mv(移動)、mvw(窗口內移動)。如 waddch(win,ch), mvwprintw(win,y,x,fmt,...)。mvwin(), wrefresh(), wclear(), werase()scrollok(win,TRUE), scroll(win)wnoutrefresh() + doupdate()(批量更新)。subwin(parent, lines, cols, y, x):共享父窗口內存。touchwin(parent) 通知庫父窗口已變更。keypad(win, TRUE):啟用功能鍵(KEY_UP, KEY_F(1) 等)。has_colors(), start_color()init_pair(num, fg, bg):定義色對(如 init_pair(1, COLOR_RED, COLOR_GREEN))。COLOR_PAIR(num) 作為屬性使用(如 attron(COLOR_PAIR(1)))。COLOR_BLACK/RED/GREEN/YELLOW/BLUE/MAGENTA/CYAN/WHITE。init_color(num, r, g, b)(0~1000)。newpad(lines, cols):可大於物理屏。prefresh(pad, py,px, sy1,sx1, sy2,sx2):指定 pad 區域映射到物理屏區域。pnoutrefresh() 配合 doupdate()。man ncurses、man curs_* 系列手冊頁。