ncurses multi colores en pantalla
Quiero hacer un menú conncurses.h
y más de un color. Me refiero a algo como esto:
┌────────────────────┐
│░░░░░░░░░░░░░░░░░░░░│ <- color 1
│▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ <- color 2
└────────────────────┘
Pero si yo usoinit_pair()
, attron()
yattroff()
El color de toda la pantalla es el mismo, y no como he esperado.
initscr();
init_pair(0, COLOR_BLACK, COLOR_RED);
init_pair(1, COLOR_BLACK, COLOR_GREEN);
attron(0);
printw("This should be printed in black with a red background!\n");
refresh();
attron(1);
printw("And this in a green background!\n");
refresh()
sleep(2);
endwin();
¿Qué hay de malo con este código?
Gracias por cada respuesta!