home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / c / pcw_c.zip / DEMO_E.C < prev    next >
C/C++ Source or Header  |  1991-12-28  |  1KB  |  36 lines

  1. /***************************************************************/
  2. /* File Id.                     DEMO_E.C.                      */
  3. /* Author.                      Stan Milam.                    */
  4. /*                                                             */
  5. /* This demo function will open a window and scroll its con-   */
  6. /* tents until a MOUSE or KEYBOARD key is pressed.             */
  7. /*                                                             */
  8. /***************************************************************/
  9.  
  10. #include <stdio.h>
  11. #include <pcwproto.h>
  12.  
  13. int demo_e(void) {
  14.  
  15.     WNDPTR *wnd;
  16.     int    i,ch;
  17.  
  18.     if ( mpresent ) hide_mouse();
  19.     setborder(SINGLEALL);
  20.     bordercolor(WHITE,GREEN);
  21.     titlecolor(WHITE,RED);
  22.     wnd = wexplode(6,20,18,60,WHITE,GREEN);
  23.     wtitle(wnd, TOP,LEFT, " Window Scrolling ");
  24.     for (i=3;i<8;i++)
  25.         wprints(wnd,i,CENTER,BLUE,GREEN," A sample window scrolling ");
  26.     do {
  27.        rest(9);
  28.        wscroll(wnd,1,3);
  29.        rest(9);
  30.        wscroll(wnd,1,-3);
  31.     } while ((ch = keypressed()) == 0);
  32.     if ( ch != 3 ) keybrd_flush();
  33.     wnd = wpop( wnd );
  34.     return 0;
  35. }
  36.