home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 19 / CD_ASCQ_19_010295.iso / dos / prg / c / cwl30 / cwl3demo / cwlfunc3.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-12  |  878 b   |  34 lines

  1. #include "cwldemo.h"
  2.  
  3. int WinColor (POPUP_MENU_PTR p, int sel)
  4. {
  5.   WPOINTER cw;
  6.   int i;
  7.   cw = WindowInitialize(DESKTOP_WINDOW,
  8.                         BORDER,0,0,40,1,BLACKONCYAN,BLACKONCYAN,SINGLEBOX);
  9.   WindowWriteCenterString(cw,"You can change text colors ...",0);
  10.   WindowCenter(cw,VERTCENTER | HORIZCENTER);
  11.   WindowDisplay(cw,1,NOEFFECT);
  12.  
  13.   for (i = 1; i < 16; i++)
  14.   {
  15.     WindowChangeTextAttribute(cw,
  16.          CREATE_VIDEO_ATTRIBUTE(GET_BGROUND_COLOR(WINDOW_TEXT_COLOR(cw)),i));
  17.     delay_approx(1000);
  18.   }
  19.  
  20.   delay_approx(5000);
  21.  
  22.   WindowWriteCenterString(cw,"You can change border colors ...",0);
  23.  
  24.   for (i = 1; i < 16; i++)
  25.   {
  26.     WindowChangeBorderAttribute(cw,
  27.          CREATE_VIDEO_ATTRIBUTE(GET_BGROUND_COLOR(WINDOW_BORDER_COLOR(cw)),i));
  28.     delay_approx(1000);
  29.   }
  30.  
  31.   WindowClose(cw,NOEFFECT);
  32.   return POPUP_CONTINUE;
  33. }
  34.