/****************************************************************************

				ShowGad.c

	This file should be linked together with a compiled version
	of Stolen.c, or whatever it's name may be. That file must
	contain the following:
	 - A struct Gadget gad1.

					Rick van Rein, October 2, 1990

****************************************************************************/



#include <functions.h>

#include <Intuition/Intuition.h>


void *IntuitionBase;

extern struct Gadget gad1;



/***** The main routine of the showing mechanism: */


struct NewWindow nwin =
 {
   0, 0, 0, 0,
   -1, -1,
   CLOSEWINDOW,
   SMART_REFRESH | WINDOWDEPTH | WINDOWCLOSE | WINDOWDRAG,
   NULL,
   NULL,
   (UBYTE *) "ShowGad",
   NULL,
   NULL,
   -1, -1, -1, -1,
   WBENCHSCREEN
 };


main ()
 {
   struct Window *win;

   IntuitionBase = OpenLibrary ("intuition.library", 0L);	/* This call will succeed always */
   nwin.FirstGadget = &gad1;
   nwin.Width = 10 + gad1.Width;
   if (nwin.Width < 100)
      nwin.Width = 100;
   nwin.Height = 20 + gad1.Height;
   gad1.LeftEdge = 5;
   gad1.TopEdge = 15;
   gad1.NextGadget = NULL;
   if (win = OpenWindow (&nwin))
    {
      WaitPort (win->UserPort);		/* Wait for CLOSEWINDOW message over IDCMP */
      ReplyMsg (GetMsg (win->UserPort));
      CloseWindow (win);
    }
   else
      puts ("\tShowGad: Can't open Window for the Gadget");
   CloseLibrary (IntuitionBase);
 }
