home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d1xx / d191 / blk.lha / Blk / pro.c < prev    next >
C/C++ Source or Header  |  1989-03-14  |  2KB  |  76 lines

  1. #include <stdio.h>
  2. #include <functions.h>
  3. #include <exec/types.h>
  4. #include <intuition/intuition.h>
  5.  
  6. #define OK_ID  0x80
  7. #define CAN_ID 0x81
  8. #define STR_ID 0x82
  9. #define NUMCHR 20
  10. struct TextAttr ta = { (UBYTE*)"topaz.font",8,0,0 };
  11. UBYTE undo[NUMCHR];
  12.  
  13. #define REQ col_req
  14. #include "prototype.h"
  15.  
  16.  
  17. struct NewWindow nwin = {
  18.    0,0,300,150,
  19.    -1,-1,GADGETUP|GADGETDOWN|REQCLEAR|MOUSEMOVE,
  20.    WINDOWDEPTH|WINDOWDRAG|SMART_REFRESH,
  21.    NULL,NULL,(UBYTE*)"Blocks",NULL,
  22.    NULL,0,0,0,0,WBENCHSCREEN
  23. };
  24.  
  25. struct IntuitionBase *IntuitionBase;
  26.  
  27.  
  28. main(argc,argv)
  29.    int argc;
  30.    char *argv[];
  31. {
  32.    struct Window *win;
  33.  
  34.    IntuitionBase=(struct IntuitionBase *)OpenLibrary("intuition.library",0L);
  35.    if (IntuitionBase) {
  36.       nwin.Width = REQ.Width + 10;
  37.       nwin.Height = REQ.Height + 14;
  38.       win = OpenWindow (&nwin);
  39.       if (win) {
  40.          Body (win);
  41.          CloseWindow (win);
  42.       }
  43.       CloseLibrary (IntuitionBase);
  44.    }
  45. }
  46.  
  47.  
  48.  
  49. Body(win)
  50.    struct Window *win;
  51. {
  52.    struct IntuiMessage *im;
  53.    BOOL looping=TRUE;
  54.    ULONG class;
  55.  
  56. /* set up proportional gadgets
  57.    scol_pinfo[0].HorizBody = ((long)0xffff)/16;
  58.    scol_pinfo[1].HorizBody = ((long)0xffff)/16;
  59.    scol_pinfo[2].HorizBody = ((long)0xffff)/16;
  60.  */
  61.    REQ.LeftEdge = 5;
  62.    REQ.TopEdge = 12;
  63.    Request (&REQ,win);
  64.  
  65.    while (looping) {
  66.       im = (struct IntuiMessage *) GetMsg(win->UserPort);
  67.       if (!im) WaitPort (win->UserPort);
  68.        else {
  69.          printf ("Message: %lx\n", im);
  70.          class = im->Class;
  71.          ReplyMsg (im);
  72.          if (class == REQCLEAR) looping = FALSE;
  73.        }
  74.    }
  75. }
  76.