home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / progm / tc-book.zip / CCOLOR.C next >
Text File  |  1987-08-20  |  998b  |  45 lines

  1. /* ------------ ccolor.c ------------ */
  2.  
  3. #include "twindow.h"
  4. #include "keys.h"
  5.  
  6. void ccolor()
  7. {
  8.     WINDOW *wndA, *wndB, *wndC;
  9.     int c;
  10.  
  11.     wndA = establish_window(8, 8, 9, 19);
  12.     wndB = establish_window(13, 6, 9, 20);
  13.     wndC = establish_window(16, 11, 9, 12);
  14.     set_colors(wndA, ALL, RED, YELLOW, BRIGHT);
  15.     set_colors(wndB, ALL, AQUA, YELLOW, BRIGHT);
  16.     set_colors(wndC, ALL, WHITE, YELLOW, BRIGHT);
  17.     display_window(wndA);
  18.     display_window(wndB);
  19.     display_window(wndC);
  20.     do    {
  21.         c = get_char();
  22.         switch (c)    {
  23.             case 'r':
  24.                 set_title(wndB, " RED ");
  25.                 set_colors(wndB, ALL, RED, WHITE, BRIGHT);
  26.                 break;
  27.             case 'b':
  28.                 set_title(wndB, " BLUE ");
  29.                 set_colors(wndB, ALL, BLUE, WHITE, BRIGHT);
  30.                 break;
  31.             case 'g':
  32.                 set_title(wndB, " GREEN ");
  33.                 set_colors(wndB, ALL, GREEN, WHITE, BRIGHT);
  34.                 break;
  35.             default:
  36.                 break;
  37.         }
  38.     } while (c != ESC);
  39.     delete_window(wndA);
  40.     get_char();
  41.     delete_window(wndC);
  42.     get_char();
  43.     delete_window(wndB);
  44. }
  45.