【问题标题】:Different window's border color using NCurses使用 NCurses 的不同窗口的边框颜色
【发布时间】:2011-05-30 08:08:39
【问题描述】:

我在终端中运行了几个 NCurses 窗口。是否可以为每个窗口设置其他边框颜色?我尝试了下面的代码,但它不起作用:

start_color()
// ...

init_pair (1, COLOR_RED, COLOR_CYAN);
attron (COLOR_PAIR (1));
box (window, 0,0);
wrefresh (window);
attroff (COLOR_PAIR (1));

【问题讨论】:

    标签: colors window ncurses


    【解决方案1】:

    您可以像这样为整个窗口设置 COLOR_PAIR:

    wbkgd(WINDOW* your_window,COLOR_PAIR(nb_of_you_pair))
    

    只为盒子设置颜色:

    wattron(win,COLOR_PAIR)
    box(win,0,0)
    wattroff(win,COLOR_PAIR)
    

    【讨论】:

      猜你喜欢
      • 2011-10-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-08
      • 2011-08-18
      • 1970-01-01
      • 2013-06-19
      相关资源
      最近更新 更多