/************************************************************************
*   Copyright 1986 by Doug Caruthers                                    *
*                                                                       *
*                                                                       *
************************************************************************/

#include "prog.h" /* Amiga header files and set-up routine are here */


main(argc,argv)
char *argv[];
int argc;
{
   printf("Starting the program:\n");

   initwind();    /* Initialize screen and window */
   printf("This will be in the window:\n");

   do         /* Event loop */
   {
      if(w->UserPort->mp_SigBit) /* Did we get an InituiMessage? */
      {
         message = (struct IntuiMessage *)GetMsg(w->UserPort);
         if(message != NULL)
         {
            class = message->Class; /* Yep, store it */
            ReplyMsg(message);   /* and Reply... */
         }
      }
   } while(event()); /* Keep on looping until an event occurs" */

   ClearMenuStrip(w);   /* detatch menu */
   CloseWindow(w);      /* Close our window */
/*   CloseScreen(screen);  * and our screen */
}   /* EXIT */

event()   /* Check for an event that we may want */
{
   switch(class)
   {
      case CLOSEWINDOW:     /* Did the user click the close box? */
         return(0);   /* Yes, return FALSE to break the loop */ 
         break;
      default:
         return(1);   /* No, loop */
         break;
   }
}

/*END*/

