C (199/207)

From:Steffen
Date:30 Dec 99 at 03:47:11
Subject:Re: event handling problem

From: Steffen <steffen.mars@stenloese.mail.telia.com>

On 29-Dec-99, Ben Hutchings wrote:

> From: Ben Hutchings <womble@zzumbouk.demon.co.uk>
>
> On Sun, Dec 26, 1999 at 10:31:19PM -0500, Bob Lanham wrote:
> <snip>
>> Thanks for the tip regarding break/return. It gave me the idea of
>> replying to any and all messages at the top, before going into the
>> switch block, and only dealing with a single possible message. It
>> works!
>>
>> message = (struct IntuiMessage *)GetMsg(win->UserPort);
>> mclass = message->Class;
>> code = message->Code;
>>
>> // reply to all messages
>> while (NULL != (message = (struct IntuiMessage
>> *)GetMsg(win->UserPort)))
>> ReplyMsg((struct Message *)message);
> <snip>
>
> But this code throws away all the other messages. You don't want to
> do that.

Agreed... Not unless we have received a IDCMP_CLOSEWINDOW, at wich point we would like to reply all messages, before we close our window. The above example will unable us to que signals, wich is NOT a bonus. Just reply the messages BEFORE you close the window, and you'll be fine.