mouseUp and ?? not in pendingMessages

Jeanne A. E. DeVoto jeanne at runrev.com
Wed Apr 17 02:30:01 EDT 2002


At 6:45 PM -0700 4/16/2002, Dar Scott wrote:
>> There's no reason it should. It's not in the pendingMessages at
>> that point,
>> since you haven't used "send in time" to send a mouseUp message.
>
>OK.  I guess pendingMessages is only for "pending messages" sent by
>"send in time".

Right.

>If, during my execution of my handler, some mouse clicks come in,
>some "send in time" come due, and some call-backs are ready, in
>what order are these executed at the end of the handler?

In general, only one handler (or chain of handler, if one handler calls
another) is executing at a time. If a message comes in while the handler is
executing - either from a user event like a click, or a queued message from
"send in time" - that message starts through the message path after the
executing handler (and any calling handlers) are done.

To take a slightly complex example, suppose you have a button with a
mouseUp handler that looks like this:

  on mouseUp
    doSomething -- another handler, which takes a while to run
    doSomethingElse -- still another handler
  end mouseUp

And suppose the card script contains a returnKey handler.

When you click the button, the mouseUp handler starts executing. It calls
the doSomething handler, which (as noted above) takes a while to finish. If
you press Return while "doSomething" is executing, the returnKey handler
doesn't execute until *after* "doSomething" and its caller, the mouseUp
handler, are both finished. Only when the mouseUp handler exits does the
returnKey message get sent.

(The exception is if you've used "wait...with messages", in which case
messages sent during the wait can be handled before the handler with the
wait command is finished executing.)

If more than one event happens or queued message is sent while the mouseUp
is executing - for example, if you click again, then you type Return - the
messages are sent in the order received. (In this example, mouseUp would be
sent again, then returnKey.) It looks like in this situation, queued
messages are sent before any events are processed - I'll check on this to
be sure.

--
Jeanne A. E. DeVoto ~ jeanne at runrev.com
Runtime Revolution Limited - The Solution for Software Development
http://www.runrev.com/





More information about the use-livecode mailing list