藍森林首頁 | 返回主頁 | 本站地圖 | 站內搜索 | 聯繫信箱 |
 您目前的位置:首頁 > 自由軟件 > 技術交流 > 應用編程


    

藍森林 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 太大了,改小一些就好了,好像該值應該有一定的範圍。



Copyright © 1999-2000 LSLNET.COM. All rights reserved. 藍森林網站 版權所有。 E-mail : webmaster@lslnet.com