home *** CD-ROM | disk | FTP | other *** search
/ Point Programming 1 / PPROG1.ISO / c / sclib31 / examples / listwind.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-12-31  |  919 b   |  49 lines

  1. #include <scl1.h>
  2. #include <scl1clor.h>
  3.  
  4.     /*********************
  5.       ListWindow example */
  6.  
  7. char *Items[]={     /* Array of items to display */
  8.     "11111",
  9.     "22222",
  10.     "33333",
  11.     "44444",
  12.     "55555",
  13.     "66666",
  14.     "77777",
  15.     "88888",
  16.     "99999",
  17.     "00000",
  18.     0,               /* terminated with a "0" */
  19.     };
  20.  
  21. char TagA[10];
  22.  
  23. main()
  24. {
  25. int EMess;
  26. LWData lw;               /* set lw as type LWData */
  27.  
  28. Cls(7,CLS_ALL);
  29. ListWindow(LW_INIT,&lw);
  30. lw.UpperRow=5;           /* Set window size */
  31. lw.LowerRow=9;
  32. lw.LeftCol=20;
  33. lw.RightCol=34;
  34. lw.RColor=WHITE_BLACK+HIGHLIGHT;
  35.  
  36. lw.TagArray=TagA;       /* tag array */
  37. lw.Array=Items;         /* data */
  38.  
  39. ListWindow(LW_DRAW,&lw);        /* draw */
  40. InitMouse(IM_SHOW);
  41.  
  42. do
  43.     {
  44.     EMess=ListWindow(LW_ACTIVE,&lw);
  45.     if(EMess==LW_ILLEGAL_KEY)
  46.         LW_MoveTo(&lw);
  47.     }while(EMess != LW_EXIT_KEY);
  48. }
  49.