I'm trying to display a statusbar using ncurses with "---" between items, like most terminal programs do.
I have the following code so far:
#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, 0, a.c_str());
getch();
endwin();
}
The mvprintw should output the whole width of the screen until the right border. But in fact, only one "-" is appended.
I'm not sure if this is a an ncurses problem or if strings are not converted to c style strings properly. Could someone help me identify the issue?