home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / progm / tc-book.zip / PROMOTE.C < prev    next >
Text File  |  1987-08-20  |  1KB  |  52 lines

  1. /* ------------ promote.c ------------ */
  2.  
  3. #include "twindow.h"
  4. #include "keys.h"
  5.  
  6. void promote()
  7. {
  8.     WINDOW *wndA, *wndB, *wndC;
  9.     int c;
  10.  
  11.     wndA = establish_window(5, 5, 9, 19);
  12.     wndB = establish_window(10, 3, 9, 20);
  13.     wndC = establish_window(13, 8, 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.     wprintf(wndA, "\n\n Window A");
  21.     wprintf(wndB, "\n\n Window B");
  22.     wprintf(wndC, "\n\n Window C");
  23.     do    {
  24.         c = get_char();
  25.         switch (c)    {
  26.             case 'a':    forefront(wndA);
  27.                         break;
  28.             case 'b':    forefront(wndB);
  29.                         break;
  30.             case 'c':    forefront(wndC);
  31.                         break;
  32.             case 'A':    rear_window(wndA);
  33.                         break;
  34.             case 'B':    rear_window(wndB);
  35.                         break;
  36.             case 'C':    rear_window(wndC);
  37.                         break;
  38.             default:    break;
  39.         }
  40.     } while (c != ESC);
  41.     delete_window(wndA);
  42.     get_char();
  43.     delete_window(wndC);
  44.     get_char();
  45.     delete_window(wndB);
  46. }
  47.  
  48.  
  49.  
  50.  
  51.  
  52.