home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 2 / DATAFILE_PDCD2.iso / utilities2 / desklib / Libraries / Icon / c / WhichRadio < prev   
Encoding:
Text File  |  1992-03-23  |  699 b   |  27 lines

  1. #include "Wimp.h"
  2. #include "WimpSWIs.h"
  3.  
  4. extern int Icon_WhichRadio(window_handle window,
  5.                            icon_handle first, icon_handle last)
  6. /*
  7.  * This function accepts parameters for the first (lowest numbered) and
  8.  * last (highest numnbered) in a group of icons (generally a group of radio
  9.  * buttons). It returns the icon number of the first icon it finds within
  10.  * this range which is selected (or "last" if none are selected).
  11.  * Use it to find which of a group of radios is selected.
  12.  */
  13. {
  14.   icon_block istate;
  15.  
  16.   while (first < last)
  17.   {
  18.     Wimp_GetIconState(window, first, &istate);
  19.     if (istate.flags.data.selected)
  20.       return(first);
  21.  
  22.     first++;
  23.   }
  24.  
  25.   return(last);
  26. }
  27.