我的目标:将窗口背景设置为特定颜色。
我当前的代码:
import curses
def do_it(win): # Shia LeBeouf!
win.bkgd(' ', curses.COLOR_BLUE)
win.addstr(1,1, "This is not blue")
win.getch()
if __name__ == '__main__':
curses.wrapper(do_it)
我的期望是我的窗口是蓝色的,上面显示“这不是蓝色”。但实际上我得到了这个窗口:
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$This$is$not$blue$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
甚至它并不是非常蓝。
我也尝试过以下方法:
win.bkgd(curses.COLOR_BLUE)
- 似乎会移除所有的空格(?)win.bkgdset(' ', curses.COLOR_BLUE)
- 看起来也是同样的结果
然而,这些方法都无济于事。
问题依然存在:如何在curses中设置窗口的背景色?