/***************************************
 *                                     *
 * Program: First Alert                *
 * =================================== *
 *                                     *
 * Author: Date:       Comments:       *
 * ------  ----------  ----------      *
 * Wgb     12/29/1987  First Alert     *
 *                                     *
 *                                     *
 ***************************************/


#include <exec/types.h>
#include <intuition/intuition.h>


struct IntuitionBase *IntuitionBase;

struct AlertMessage
{
   SHORT LeftEdge;
   BYTE TopEdge;
   char AlertText[50];
   BYTE Flag;
};

#define NOEND 0xFF
#define END   0x00

struct AlertMessage UserAlert[] =
{
   50, 24, "    This is the first alert I have written!!!    ", NOEND,
   50, 34, "    -----------------------------------------    ", NOEND,
   50, 44, "                                                 ", NOEND,
   50, 54, "    <Left Button> CANCEL   <Right Button>   RETRY", END
};

main()
   {
   BOOL Reply;
   
   Open_All();
   
   Reply = DisplayAlert(RECOVERY_ALERT, &UserAlert, 80L);
   
   if (Reply == TRUE)
      printf("Left mouse button was pressed!\n");
   else
      printf("Right mouse button was pressed!\n");
   
   Close_All();
   }


/***************************************
 *                                     *
 * Function: Open all                  *
 * =================================== *
 *                                     *
 * Author: Date:       Comments:      *
 * ------  ----------  ----------      *
 * Wgb     10/16/1987  for Intuition   *
 *                                     *
 ***************************************/

Open_All()
   {
   void          *OpenLibrary();
   
   if (!(IntuitionBase = (struct IntuitionBase *)
       OpenLibrary("intuition.library", 0L)))
      {
      printf("Intuition Library not found!\n");
      Close_All();
      exit(FALSE);
      }
   }


/***************************************
 *                                     *
 * Function: Cloae all                 *
 * =================================== *
 *                                     *
 * Author: Date:       Comments:       *
 * ------  ----------  ----------      *
 * Wgb     10/16/1987  for Intuition   *
 *                                     *
 ***************************************/

Close_All()
   {
   if (IntuitionBase)   CloseLibrary(IntuitionBase);
   }

