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

				ShowMenu.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 list of Menus: Together they should be a MenuBar.
	When compiling, give in an option the name of the first struct Menu
	in the linked list, that is the last structure in Steal's output:
		cc -Dmenu=men3 ShowMenu.c

					Rick van Rein, October 2, 1990

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



#include <functions.h>

#include <Intuition/Intuition.h>


struct IntuitionBase *IntuitionBase;


#ifndef menu
   #define menu men1
#endif

extern struct Menu menu;


/***** This routine opens a Window with a Close-Gadget in it: */


#define BLUE_0      0
#define WHITE_1     1
#define BLACK_2     2
#define ORANGE_3    3


struct NewWindow closewin =
 {
   30,30,					/* LeftEdge,TopEdge */
   368,10,					/* Width,Height */
   BLUE_0,WHITE_1,				/* DetailPen,BlockPen */
   CLOSEWINDOW,					/* IDCMPFlags */
   WINDOWDRAG | WINDOWDEPTH | WINDOWCLOSE | SMART_REFRESH | ACTIVATE,
						/* Flags */
   NULL,					/* FirstGadget */
   NULL,					/* CheckMark */
   (UBYTE *) " <<< Click here to finish ShowMenu ",
						/* Title */
   NULL,					/* Screen */
   NULL,					/* BitMap */
   -1,-1,					/* MinWidth,MinHeight */
   -1,-1,					/* MaxWidth,MaxHeight */
   WBENCHSCREEN					/* Type */
 };

void WaitForClick (men)
 {
   struct Window *win;

   if (win=OpenWindow (&closewin))
    {
      SetMenuStrip (win,&menu);
      WaitPort (win->UserPort);
      ReplyMsg (GetMsg (win->UserPort));	/* Our Gadget was Clicked */
      CloseWindow (win);
    }
   else
      puts ("\tShowMenu: Can't open Window on Workbench Screen");
 }


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

main ()
 {
   if (!(IntuitionBase=(struct IntuitionBase *) OpenLibrary ("intuition.library",0L)))
    {
      puts ("\tShowScr1: Can't open intuition.library (?)");
      exit (0);
    }
   WaitForClick ();

   CloseLibrary (IntuitionBase);
 }
