2 * $Id: color_set.c,v 1.2 2003/12/07 00:08:47 tom Exp $
7 #define SHOW(n) ((n) == ERR ? "ERR" : "OK")
10 main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
22 pair_content(0, &f, &b);
23 printw("pair 0 contains (%d,%d)\n", f, b);
26 printw("Initializing pair 1 to red/black\n");
27 init_pair(1, COLOR_RED, COLOR_BLACK);
28 i = color_set(1, NULL);
29 printw("RED/BLACK (%s)\n", SHOW(i));
32 printw("Initializing pair 2 to white/blue\n");
33 init_pair(2, COLOR_WHITE, COLOR_BLUE);
34 i = color_set(2, NULL);
35 printw("WHITE/BLUE (%s)\n", SHOW(i));
38 printw("Resetting colors to pair 0\n");
39 i = color_set(0, NULL);
40 printw("Default Colors (%s)\n", SHOW(i));
43 printw("Resetting colors to pair 1\n");
44 i = color_set(1, NULL);
45 printw("RED/BLACK (%s)\n", SHOW(i));
49 printw("This demo requires a color terminal");
54 ExitProgram(EXIT_SUCCESS);