
#include <stdlib.h>
#include <proto/intuition.h>
#include <intuition/intuition.h>
#include <proto/exec.h>
#include <proto/graphics.h>

#ifndef GUINAME
#include "test.h"
#else
#include GUINAME
#endif

extern struct IntuitionBase *IntuitionBase;
extern struct GfxBase *GfxBase;
extern struct Library *GadToolsBase;

main()
{
   struct IntuiMessage msg;
   struct Window *win;
   int run=1;

   win=OpenWindowTags(NULL,
            WA_Left,0,WA_Top,20,
            WA_Width,300,WA_Height,100,
            WA_Title,TITLE,
            WA_IDCMP,BUTTONIDCMP|IDCMP_CLOSEWINDOW|SLIDERIDCMP|
                     IDCMP_NEWSIZE|IDCMP_REFRESHWINDOW,
            WA_Flags,WFLG_SIZEGADGET|WFLG_DRAGBAR|WFLG_DEPTHGADGET
                        |WFLG_SIMPLE_REFRESH
                        |WFLG_CLOSEGADGET|WFLG_ACTIVATE,
            WA_MinWidth,300,WA_MinHeight,100,
            WA_MaxWidth,-1,WA_MaxHeight,-1,
            TAG_DONE );

   if(!win) exit(0);

   if(RenderGui(win,&TestPro)) {CloseWindow(win);exit(0);}

   while(run) {
      WaitPort(win->UserPort);
      while(Gui_GetIMsg(win->UserPort,&msg)) {
         switch(msg.Class) {
            case IDCMP_CLOSEWINDOW: run=0;
                                    break;
            case IDCMP_NEWSIZE:     ResizeGui(&TestPro);
                                    break;
            case IDCMP_REFRESHWINDOW:
                                    RefreshGui(&TestPro);
                                    break;
            case IDCMP_GADGETUP:
                                    break;
         }
      }
   }
   FreeGui(&TestPro);
   CloseWindow(win);
   return(0);
}



