CompuServe Thread

#GetMsg

4 messages in this thread
#194From: ROBBY PLOURDEJul 13, 1988 9:59 AM
I seem to be having trouble with GetMsg. Here's what i'm doing. I have a program which needs to scroll a section of my window, until I get a message from the window's port. What I want is, a user clicks a scroll gadget, I get a GADGETDOWN message then go to a routine that continuously scrolls the window until I receive a GADGETUP message. Now, the way I do it is this, I do a WaitPort on the window's user port. Then I do a GetMsg, copy the info over, then ReplyMsg. I then go to a function the does a ScrollRaster on the window, then does a GetMsg, if GetMsg returned NULL I then repeat the cycle of ScrollRaster, GetMsg, etc. until GetMsg != NULL (that's not equal to) Now, for some reason, right away GetMsg returns a value that seems to be bogus. The Class code I get back doesn't even come close to anything. Can anyone help? Rob
#196From: Steve AhlstromJul 13, 1988 11:00 AM
Do something like: WaitPort(req->UserPort); mess = (struct IntuiMessage *)GetMsg(req->UserPort); GadAddress = (struct Gadget *)mess->IAddress; class = mess->Class; ReplyMsg(mess); … case GADGETDOWN: gad_id = GadAddress->GadgetID; switch (gad_id) { case SCROLL_GADGET: do { scroll_stuff(); } while (GadAddress->Flags & SELECTED); break;
#218From: ROBBY PLOURDEJul 13, 1988 5:50 PM
AARRGG! Now why didn't I think of that? Guess it's too much MS-DOS! If I use RELVERIFY then that should work great, no? Thanks, Rob
#220From: Steve AhlstromJul 13, 1988 5:54 PM
I don't have RELVERIFY in my code, I just check the SELECTED flag in the while loop.