gpt4 book ai didi

colors - 使用 NCurses 的不同窗口边框颜色

转载 作者:行者123 更新时间:2023-12-02 00:54:31 28 4
gpt4 key购买 nike

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

start_color()
// ...

init_pair (1, COLOR_RED, COLOR_CYAN);
attron (COLOR_PAIR (1));
box (window, 0,0);
wrefresh (window);
attroff (COLOR_PAIR (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)

关于colors - 使用 NCurses 的不同窗口边框颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6173777/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com