home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 328_01 / wbuttong.c < prev    next >
C/C++ Source or Header  |  1991-03-28  |  620b  |  38 lines

  1.  
  2. /* wbutton_getptr()
  3.  *     this function scans the list of buttons
  4.  *    looking for a match to specified value.
  5.  *    returns NULL if not found or inactive.
  6.  *    returns ptr to button if found
  7.  */
  8. #include "wtwg.h"
  9.  
  10. #include <ctype.h>
  11.  
  12.  
  13. WBUTTON *wbutton_getptr ( int uval )
  14.     {
  15.     WBUTTON *Bptr;
  16.     
  17.     for (     Bptr = w0->winbutton;
  18.         Bptr;
  19.         Bptr = Bptr->Bchain )
  20.         {
  21.  
  22.         if ( uval == Bptr->Bval )
  23.             {
  24.             if (  ( Bptr -> Bstyle  & WBTN_ACTIVE  ) == 0 )
  25.                 {
  26.                 /* test to see if button is temp inactive
  27.                  */
  28.                 Bptr = NULL;
  29.                 }
  30.             break;
  31.             }
  32.  
  33.         }
  34.  
  35.     return (Bptr);        /* wbutton_getptr */
  36.     }
  37.  
  38.