[comp.sys.amiga.tech] GADGETDOWN problem

850031m@aucs.uucp (GORDON R. MAC GREGOR) (11/03/89)

Would anyone have an idea as to why I dont get the gadget down IDCMP
message in the code below.  I seem to be getting the other events
just fine.

[...]

/*-------------------------- The Window -------------------------------*/
struct Window *Window;
struct RastPort *rport;

struct NewWindow newwindow = {0,0,WINDOWWIDTH,WINDOWHEIGHT,-1,-1,
          CLOSEWINDOW|MOUSEBUTTONS|MENUPICK|GADGETUP|GADGETDOWN,
          WINDOWDRAG|WINDOWDEPTH|WINDOWCLOSE|
            SMART_REFRESH|REPORTMOUSE|ACTIVATE,
          &ladd_bool,NULL,(UBYTE *)TITLE,NULL,NULL,
          -1,-1,-1,-1,WBENCHSCREEN};


[...]

USHORT get_mouse(window,x,y,data)
  struct Window *window;
  SHORT  *x, *y;
  USHORT *data;
{
  USHORT flag=0;
  struct IntuiMessage *msg;
  struct Gadget *gad_address;

  Wait( 1L << window->UserPort->mp_SigBit );

  while( msg=(struct IntuiMessage *)GetMsg(window->UserPort) )
  {
    /*
       [...]
    */
    printf("+++ %ld\n",msg->Class);

  }
  if( flag )
    return flag;

  return MOUSEBUTTON;
}

[...]

bevis@EE.ECN.PURDUE.EDU (Jeff Bevis) (11/04/89)

In article <1989Nov3.041231.28697@aucs.uucp>, 850031m@aucs.UUCP (GORDON R. MAC GREGOR) writes:
>Would anyone have an idea as to why I dont get the gadget down IDCMP
>message in the code below.  I seem to be getting the other events

Are you sure that you set the GADGIMMEDIATE flag in the gadget struct?  It
won't send you a message (for gadget down) unless you do!

+--------------------------------+--------------------------------------------+
| Jeff Bevis 		         | "But I don't like spam!"		      |
| bevis@en.ecn.purdue.edu	 | 	     Give me Amiga or nothing at all. |
+--------------------------------+--------------------------------------------+