home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 15 / CD_ASCQ_15_070894.iso / maj / 680 / examples / center.c next >
C/C++ Source or Header  |  1994-03-14  |  518b  |  30 lines

  1. /*
  2. ** CENTER.C: Displays a message centered on the screen.
  3. */
  4.  
  5. #include <string.h>
  6. #include <pictor.h>
  7.  
  8. char *msg = "Hello, from the PICTOR library!";
  9.  
  10. void main()
  11. {
  12.    VIDEOSTRUCT vstruct;
  13.  
  14.    /* initialize library */
  15.    initvideo();
  16.    getvconfig(&vstruct);
  17.  
  18.    vcolor(foreback(BOLD+WHITE,BLUE));
  19.    cls();
  20.  
  21.    setvpos(center(1,vstruct.rows),
  22.       center(strlen(msg),vstruct.columns));
  23.    vputs(msg);
  24.    kbdread();
  25.  
  26.    /* restore screen */
  27.    vcolor(foreback(WHITE,BLACK));
  28.    cls();
  29. }
  30.