home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 2 / DATAFILE_PDCD2.iso / utilities2 / desklib / Libraries / Icon / c / SetSelect < prev    next >
Encoding:
Text File  |  1993-04-11  |  580 b   |  23 lines

  1. #include "Wimp.h"
  2. #include "WimpSWIs.h"
  3.  
  4. extern void Icon_SetSelect(window_handle window, icon_handle icon, int flag)
  5. /* If flag == 0, (and the icon is currently selected) it will be deselected
  6.  * If flag == 1, (and the icon is currently not selected) it will be selected
  7.  */
  8. {
  9.   icon_block istate;
  10.  
  11.   Wimp_GetIconState(window, icon, &istate);
  12.   if (flag)
  13.   {
  14.     if (!istate.flags.data.selected)
  15.       Wimp_SetIconState(window, icon, icon_SELECTED, icon_SELECTED);
  16.   }
  17.   else
  18.   {
  19.     if (istate.flags.data.selected)
  20.       Wimp_SetIconState(window, icon, 0, icon_SELECTED);
  21.   }
  22. }
  23.