home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_100 / 164_01 / wndemo.c < prev    next >
Text File  |  1984-10-07  |  1KB  |  56 lines

  1.  
  2. #include <stdio.h>
  3. #include <window.h>
  4.  
  5. main()    /* demonstration */
  6. {
  7.     WINDOWPTR wn, wn1;
  8.     int        i;
  9.  
  10. /*
  11.     for (i = 1; i < 25; i++)
  12.         printf("The quick brown fox jumped over the lazy dog's back.\n");
  13. */
  14.     if ((wn = draw_window(10, 3, 30, 10, (get_mode() < 4) ? 7 : 0)) == NULL)
  15.     {
  16.         printf("\n--- Error opening first window\n");
  17.         exit(1);
  18.     }
  19.     show_mail(wn);
  20.  
  21.     if ((wn1 = draw_window(15, 5, 30, 1, (get_mode() < 4) ? 0x70 : 255)) == NULL)
  22.     {
  23.         printf("\n--- Error opening second window\n");
  24.         exit(1);
  25.     }
  26.     write_text(wn1, " Read your mail more often!");
  27.  
  28.     ci();
  29.     remove_window(wn1);
  30.  
  31.     for (i = 5; i > -10; i -= 2)
  32.     {
  33.         clr_window(wn);
  34.         wn->cx = i;
  35.         show_mail(wn);
  36.         ci();
  37.     }
  38.  
  39.     remove_window(wn);
  40.     exit(0);
  41. }
  42.  
  43.  
  44. show_mail(wn)        /* display the MAIL message */
  45. {
  46.     write_text(wn, "Mail System");
  47.     write_text(wn, "-----------");
  48.     write_text(wn, "Messages Received:  3");
  49.     write_text(wn, "From          Date      Time");
  50.     write_text(wn, "----         ------     ----");
  51.     write_text(wn, "John         1/24/83    0935");
  52.     write_text(wn, "Kim          1/23/83    1547");
  53.     write_text(wn, "Sam          1/23/83    1117");
  54.     write_text(wn, "This line of text should be truncated before here.");
  55. }
  56.