home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 2 / DATAFILE_PDCD2.iso / utilities2 / desklib / Libraries / Icon / c / GetDouble < prev    next >
Encoding:
Text File  |  1992-04-06  |  452 b   |  21 lines

  1. #include "Wimp.h"
  2. #include "WimpSWIs.h"
  3.  
  4. #include <stdlib.h>
  5.  
  6.  
  7. extern double Icon_GetDouble(window_handle w, icon_handle i)
  8. /*
  9.  * Gets the given icon's text and returns it in the form of an integer
  10.  * numeric value. 0 will be returned from any error/invalid text
  11.  */
  12. {
  13.   icon_block istate;
  14.  
  15.   Wimp_GetIconState(w, i, &istate);
  16.   if (istate.flags.value & (icon_TEXT | icon_INDIRECTED))
  17.     return(atof(istate.data.indirecttext.buffer));
  18.  
  19.   return(0);
  20. }
  21.