我正在尝试使用ncurses在项目之间显示状态栏,就像大多数终端程序一样。
到目前为止,我有以下代码:
#include <iostream>
#include <cmath>
#include <string>
#include <curses.h>
using namespace std;
int main() {
initscr();
start_color();
init_pair(3,COLOR_WHITE,COLOR_RED);
getch();
attron(COLOR_PAIR(3));
string a = "--- Tickets: 455";
a.append(70,'-');
mvprintw(LInes-1,a.c_str());
getch();
endwin();
}
mvprintw应该输出屏幕的整个宽度,直到右边界为止。但实际上,仅附加了一个“-”。
我不确定这是否是ncurses问题,或者字符串是否未正确转换为c样式字符串。有人可以帮我找出问题吗?