I'm writing some stuff using a text based interface. I've decided to go with PDCurses, which essentially is curses for the windows DOS prompt. It mimics the traditional ncurses api in all aspects. Though I am having trouble with printing colours. I can print colours fine onto the STDSCR window, although I cannot print to any other window in colour.
Here is an example. If you are on a UNIX based system change the header to ncurses.h
Code:
int main(int argc, char *argv[])
{
initscr();
if(has_colors() == FALSE)
{
endwin();
printf("Your terminal does not support color\n");
exit(1);
}
start_color();
init_pair(1, COLOR_RED, COLOR_BLACK);
WINDOW *testwin = newwin (10, 10, 0, 0);
box (testwin, 0, 0);
wrefresh (testwin);
attron (COLOR_PAIR (1));
mvwprintw (testwin, 0, 0, "%s", "Hello");
attroff (COLOR_PAIR (1));
wrefresh (testwin);
}