home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 3 / goldfish_volume_3.bin / files / fish / disks / d1031.lha / Programs / Textfield / TestClass / TextFieldAuto.c < prev    next >
C/C++ Source or Header  |  1994-11-12  |  849b  |  39 lines

  1. /*
  2.  * TextField autoinit and autoterminate functions
  3.  * for SAS/C 6.50 and up.
  4.  *
  5.  * If you just compile and link this into your application
  6.  * then TextFieldBase and TextFieldClass will be
  7.  * automatically initialized before main() is called.
  8.  *
  9.  * Your application will only need to use TextFieldClass
  10.  * when calling NewObject() and include <proto/textfield.h>.
  11.  */
  12.  
  13. #include <exec/types.h>
  14. #include <intuition/classes.h>
  15.  
  16. #include <proto/exec.h>
  17. #include <proto/textfield.h>
  18.  
  19. struct Library *TextFieldBase;
  20. Class *TextFieldClass;
  21.  
  22. int _STI_200_TextFieldInit(void)
  23. {
  24.     TextFieldBase = OpenLibrary("gadgets/textfield.gadget", 0);
  25.     if (TextFieldBase) {
  26.         TextFieldClass = TEXTFIELD_GetClass();
  27.         return 0;
  28.     } else {
  29.         return 1;
  30.     }
  31. }
  32.  
  33. void _STD_200_TextFieldTerm(void)
  34. {
  35.     CloseLibrary(TextFieldBase);
  36.     TextFieldClass = NULL;
  37.     TextFieldBase = NULL;
  38. }
  39.