/* Look in your compiler header files for descriptions of the NewWindow */
/* and Window structures. To open a 320 X 200 screen on your Workbench */
/* screen with all default gadgets (drag bar, sizing gadgets, etc), */
/* and not having to worry about redrawing it yourself, do this. I've */
/* made it so you have to press return in the cli to end the program, */
/* because using the Close Gadget makes it a bit more complicated */
/* I learned about all this stuff from "Programmer's Guide To The Amiga" */
/* from SYBEX books which many people recommend highly, and of course */
/* The Intuition Reference manual has alot of important stuff in it also */
/* I hope this helps you out */

#include "intuition/intuition.h"

extern long IntuitionBase ;

struct NewWindow mynewwindow = {
   0, 0, 320, 100,    /* 320 X 200 with upper left at 0, 0  */
   -1, -1,            /* Defualt detail and block pens */
   NULL,              /* Dealing with IDCMP flags is much more involved */
   SMART_REFRESH | NOCAREREFRESH | WINDOWCLOSE | WINDOWSIZING | 
   WINDOWDEPTH | WINDOWDRAG, 
                    /* SMART_REFRESH tells intuition to do all redrawing */
                    /* itself. NOCAREREFRESH says don't ever tell me to */
                    /* refresh my own window */
                    
   NULL,            /* no gads in this window */
   NULL,            /* use the default checkmark */
   "Doobie's Window", /* Title */
   NULL,           /* Pointer to window's screen (or NULL for Workbench) */
   NULL,           /* This isn't a super-bitmap window */
   10, 10, 1024, 1024, /* minimum and maximum width and height */
   WBENCHSCREEN    /* Screen to put this on */
} ;
   
void main()
{
   struct Window *mywind ;
   UBYTE dummy ;
     
      /* Can't do any intuition stuff (like windows) without opening */
      /* the intuition library first */
   IntuitionBase = OpenLibrary("intuition.library", 0) ;
   if (IntuitionBase == NULL) {
      printf("Couldn't open intution library\n") ;
      exit(5) ;
   }
   mywind = (struct Window *)OpenWindow(&mynewwindow) ;
   if (mywind == NULL) {
      printf("Couldn't open window\n") ;
      CloseLibrary(IntuitionBase) ;
      exit(10) ;
   }
   scanf("%c", &dummy) ;
   CloseWindow(mywind) ;
   CloseLibrary(IntuitionBase) ;
}
   
