/*******************************************************************x****
 * This "C" program create a Custom Screen with a simple Window in it! *
 * To compile this program in Aztec C68K you must compile with 32 Bit, *
 * instead of 16 Bit.                                                  *
 ***********************************************************************/

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

struct Intuition *IntuitionBase;
struct GfxBase *GfxBase;

#define INTUITION_REV  29
#define GRAPHICS_REV   29

struct TextAttr MyFont =
   {
       "topaz.font",
       TOPAZ_EIGHTY,
   };
struct NewScreen NewScreen =
   {
       0,
       0,
       320,
       256,
       2,
       0, 1,
       NULL,
       CUSTOMSCREEN,
       &MyFont,
       "A Simple Custom Screen...",
       NULL,
       NULL,
   };






































main()
{
   struct Screen *Screen;
   struct NewWindow NewWindow;
   struct Window *Window;

   LONG i;

   IntuitionBase = (struct IntuitionBase *)
      OpenLibrary("intuition.library", INTUITION_REV);
   if (IntuitionBase == NULL)
      exit(FALSE);

   GfxBase = (struct GfxBase *)OpenLibrary("graphics.library",GRAPHICS_REV);
   if (GfxBase == NULL)
      exit(FALSE);
  
   if ((Screen = (struct Screen *)OpenScreen(&NewScreen)) == NULL)
      exit(FALSE);

   NewWindow.LeftEdge = 0;
   NewWindow.TopEdge = 11;
   NewWindow.Width = 250;
   NewWindow.Height = 100;
   NewWindow.DetailPen = 0;
   NewWindow.BlockPen = 1;
   NewWindow.Title = "Use Kickstart 1.2";
   NewWindow.Flags = WINDOWCLOSE|SMART_REFRESH|ACTIVATE
                     |WINDOWSIZING|WINDOWDRAG|WINDOWDEPTH;
   NewWindow.IDCMPFlags = CLOSEWINDOW;
   NewWindow.Type = CUSTOMSCREEN;
   NewWindow.FirstGadget = NULL;
   NewWindow.CheckMark = NULL;
   NewWindow.Screen = Screen;
   NewWindow.BitMap = NULL;
   NewWindow.MinWidth = 202;
   NewWindow.MinHeight = 26;
   NewWindow.MaxWidth = 640;
   NewWindow.MaxHeight = 256;

   if (( Window = (struct Window *)OpenWindow(&NewWindow) ) == NULL)
      exit(FALSE);

   Move(Window->RPort, 20, 20);
   Text(Window->RPort, "     HELLO     ", 15);

   Wait(1 << Window->UserPort->mp_SigBit);
   CloseWindow(Window);
   CloseScreen(Screen);
   exit(TRUE);
}
