#Wait problem continued
01-Oct-92 23:16:01
Sb: #28568-#Wait problem continued
Fm: KEITH YOUNG 73170,307
To: Jim Shaffer Jr. 72750,2335
Jim,
I don't see anything fundamentally wrong with your reasoning here, but I
would point out that as a matter of implementation, you should not be
replying a NULL message… you seem to have already determined (perhaps
through debugging it) that you are getting a NULL message, so don't reply
if it is.
It's kinda hard to say exactly what's happening, but you should be doing
something like…
alive = TRUE;
while(alive)
{
plot_pixels();
if( msg = GetMsg( window->UserPort ) )
{
if( msg->Class == MOUSEBUTTONS )
alive = FALSE;
ReplyMsg( msg );
}
}
while( msg = GetMsg( window->UserPort ) )
ReplyMsg( msg );
CloseWindow( window );
.. this is a bit simplified, but was meant to point out that you should
only reply to a messsage _if_ you get one.
– Keith