I have read several explanations of why DoEvents are to be avoided in GUI
applications, but I remain confused.  Someday maybe I will have time to
figure out how to program a thread, but in the meantime, there do seem to be
situations where DoEvents would be quite safe to use in a GUI application.

I'll take a stab at what I understand as a novice, and maybe someone can
point out what I a missing.  When a RB GUI application runs, is executes a
loop that checks for all possible events, unless, for example, some event
has started a long calculation.  In that case, RB will not respond to any
mouse or keyboard input until the calculation is completed. To allow
breaking out of the calculation, one might be tempted to insert a DoEvents
call into the loop, so the keyboard can be responded to.  If I understand
correctly, the problem with this is that when RB breaks out of the loop
momentarily to see if anything else needs attention, it might find an event
that leads back to a call to the routine that was doing the calculation, and
eventually lead to stack overflow.  But if the only way to get into the
method that runs this calculation is with a command button that was disabled
when the method was called, and not re-enabled again until the method was
finished, how could this DoEvents cause any trouble?


David Graham




-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Ken
Jordan
Sent: Thursday, April 20, 2006 8:10 AM
To: REALbasic NUG
Subject: Re: Don't want to use App.DoEvents anymore!!!

Peter K. Stys wrote:

[snip]

>(I use it frequently and have never been
>bitten, what's the problem with this call anyway?)
>
See:
http://ramblings.aaronballman.com/?p=196
http://support.realsoftware.com/listarchives/realbasic-nug/2006-01/msg00002.
html

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to