#Wait problem continued
Here's the details on my IDCMP problem. Hopefully I'm just doing something
stupid and it can be easily fixed.
I've got a window open and I'm plotting a fractal in it. Eventually I'll
hang a menu on it, but for now I just wanted to be able to click on the
window to stop the plot if it's not going like I wanted. (Experimental
color mappings, etc.) To that end, I've set the IDCMP_MOUSEBUTTONS flag on
the window (and that's the only one.) If I understand correctly, this
should give me two IDCMP messages — one when the button goes down, and
another when it's released. So after each point is plotted, I check for a
message. If I don't get it, I go on to the next point. If I get it, I
reply to it. Then, I know that it was the message for the button being
pushed, and there should be another for the button being released. So I
check for another message. If it's there, I reply to it and exit.
Everything is OK. If it's not there, it must mean the user hasn't let go
'of the button by the time the program got to this point. Here's where the
problem starts! I do a Wait(1 << window->UserPort->mp_SigBit). By
printing out the message pointer, I've found out that the program is going
right through the Wait(), and GetMsg then returns a message pointer of
zero. Of course, replying to this immediately kills the system, with an
error number of 80000025.
So, why is it ignoring the Wait? I've written a test program without all
the plotting code etc., and it happens there too. I could post it if
someone tells me how to keep CIS from reformatting my messages.