home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c003 / 1.ddi / DEMOS / HELLO_WC.C < prev    next >
Encoding:
C/C++ Source or Header  |  1987-02-02  |  1.2 KB  |  36 lines

  1. /* hello_wc.c -- demo of color capabilities using physical attributes
  2.  
  3. */
  4.  
  5. #define WN_DEBUG
  6. #include <wfc.h>
  7. #undef ATT_LOGIC
  8. #include <wfc_glob.h>
  9.  
  10. main()
  11. {
  12.     WINDOW wn;
  13.     int kc;
  14.  
  15.     init_wfc();             /*initialize WFC              */
  16.     vid_mode(CO80);            /*80 column color display          */
  17.     vid_bdr(YELLOW);            /*yellow screen border              */
  18.     color_sc(GREEN);            /*set clear attribute to green          */
  19.     cls();                /*clear screen with green background  */
  20.     defs_wn(&wn, 5, 20, 10, 40, &bdr_dln);
  21.     color_wn(WHITE, BLUE, &wn);     /*must follow defs_wn()           */
  22.     sw_bdratt(c_att(YELLOW, BLACK), &wn);      /*yellow border for window     */
  23.     set_wn(&wn);            /*set window on screen              */
  24.     v_st("\nHello, world\n", &wn);
  25.     mv_cs(v_rwq - 1, 0, &wn0);        /*location for message at bottom      */
  26.     sw_att(c_att(RED, BLACK), &wn0);    /*change attribute for wn0          */
  27.     v_st("Do you want to change to a Monochrome Display Adapter ? (y/n): ", &wn0);
  28.     pl_csr(&wn0);            /*cursor at end of message          */
  29.     kc = ki();                /*wait for keystroke              */
  30.     if(kc == 'y' || kc == 'Y')
  31.     vid_mode(MONO);         /*go to Monochrome display          */
  32.     exit_wfc();
  33.     return(0);
  34. }
  35.  
  36.