|
藍森林 http://www.lslnet.com 2006年6月6日 10:18
curses 在redhat8下無法顯示顏色(附我的程序)
[code]
#include <curses.h>;
main()
{
initscr();
refresh();
/*start_color();*/
init_pair(100,COLOR_WHITE,COLOR_BLUE);
attron(COLOR_PAIR(100));
mvprintw(10,20,"This is a test");
attroff(COLOR_PAIR(100));
refresh();
/*getch();*/
endwin();
}
[/code]
去掉程序中的註釋也無法顯示顏色,望高手指教,redhat8.0 |
curses 在redhat8下無法顯示顏色(附我的程序)
不好意思,是我定義的 100 太大了,改小一些就好了,好像該值應該有一定的範圍。 |
| |