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

  1. #include <scl1.h>
  2.  
  3.     /*********************
  4.         TagList2 example */
  5.  
  6. char *options[]={
  7.      "Option 1",
  8.      "Option 2",
  9.      "Option 3",
  10.      "Option 4",
  11.      "Option 5",
  12.      "Option 6",
  13.      "Option 7",
  14.      0};
  15.  
  16. char tarray[7];
  17.  
  18. main()
  19. {
  20. TLData tl;
  21. int i,Mess;
  22.  
  23. TagList2(TL_INIT,&tl);        /* initialize structure */
  24. tl.UpperRow=6;                /* modify position */
  25. tl.LowerRow=15;
  26. tl.LeftCol=20;
  27. tl.RightCol=60;
  28. tl.Array=options;             /* our data*/
  29. tl.TagArray=tarray;           /* tag array */
  30. TagList2(TL_DRAW,&tl);        /* draw */
  31. InitMouse(IM_SHOW);
  32. Mess=TagList2(TL_ACTIVE,&tl); /* active */
  33. if(Mess==TL_OK)
  34.      {
  35.      printf("\nThe following options were tagged:\n");
  36.      for(i=0;i < 7;++i)
  37.           {
  38.           if(tarray[i])
  39.           printf("%s\n",options[i]);
  40.           }
  41.      }
  42. else
  43.      printf("\nOperation canceled by user\n");
  44. }