home *** CD-ROM | disk | FTP | other *** search
/ Aminet 15 / Aminet 15 - Nov 1996.iso / Aminet / dev / misc / BST_SystemDocs.lha / BeastV1 / Examples / BST_System / BST_ApplicationExample.c next >
Encoding:
C/C++ Source or Header  |  1996-09-03  |  1.7 KB  |  80 lines

  1. /****h* Beast/BST_ApplicationExample.c ****************
  2. *
  3. *    NAME
  4. *      BST_ApplicationExample -- (V1 Bravo)
  5. *
  6. *    COPYRIGHT
  7. *      Maverick Software Development
  8. *
  9. *    FUNCTION
  10. *
  11. *    AUTHOR
  12. *      Jacco van Weert
  13. *
  14. *    CREATION DATE
  15. *      2-Apr-96
  16. *
  17. *    MODIFICATION HISTORY
  18. *
  19. *    NOTES
  20. *
  21. ****************************************************
  22. */
  23. #include <BEAST:Include/proto/Beast.h>
  24. #include <proto/exec.h>
  25. #include <stdio.h>
  26. #include <exec/memory.h>
  27. #include <dos/dos.h>
  28.  
  29. struct Library *BeastBase;
  30.  
  31. struct TagItem EmptyList[] =
  32. {
  33.   {TAG_DONE, 0}
  34. };
  35.  
  36.  
  37. /*********************************/
  38. /**** M A I N - P R O G R A M ****/
  39. /*********************************/
  40. main()
  41. {
  42.   struct BST_Object *AppObject;
  43.  
  44.   printf("*** Beast General ApplicationExample START ***\n");
  45.  
  46.   /************************************************
  47.    **** Open beast.library 2 or higher 2 = V1 Bravo
  48.    ****/
  49.   if (BeastBase = (struct Library *)OpenLibrary( "beast.library", 2 ))
  50.     {
  51.       if (AppObject = OBJ_NewObject( NULL, "BST_ApplicationClass", NULL ))
  52.     {
  53.  
  54.       /********************************
  55.        **** Trigger the OBM_INIT method
  56.        ****/
  57.       OBJ_DoMethod( AppObject, OBM_INIT, EmptyList, 0 );
  58.  
  59.       struct TagItem TL_SetAppAttr[] =
  60.         { {BTA_NumberOf,   2},
  61.           {BTA_Signals_OR, SIGBREAKF_CTRL_C},
  62.           {BTA_Title,        (ULONG)"My_Application"},
  63.           {TAG_DONE,        0}
  64.         };
  65.       OBJ_DoMethod( AppObject, OBM_SETATTR, TL_SetAppAttr, 0 );
  66.  
  67.       OBJ_DoMethod( AppObject, OBM_EVENTLOOP, EmptyList, 0 );
  68.  
  69.     }
  70.  
  71.       /**************************
  72.        **** Get rid of our object
  73.        ****/
  74.       OBJ_DestroyObject( AppObject, MTHF_DOCHILDREN );
  75.  
  76.       CloseLibrary( BeastBase );
  77.     }
  78.   printf("*** Beast General ApplicationExample END ***\n");
  79. }
  80.