Two handlers sharing time
Chipp Walters
chipp at chipp.com
Tue Dec 18 17:23:01 EST 2001
Scott,
What does "with messages" do? And why can't I find the "with" or "without"
words in the transcript dictionary? And what does "without" do? I understand
the English syntax, but not the transcript. thanks,
Chipp
-----Original Message-----
From: metacard-admin at lists.runrev.com
[mailto:metacard-admin at lists.runrev.com]On Behalf Of Scott Rossi
Sent: Tuesday, December 18, 2001 2:43 PM
To: metacard at lists.runrev.com
Subject: Re: Two handlers sharing time
Recently, Shari wrote:
> Is it possible to have handlers share time? So that when it is idle,
> the second handler runs?
>
> I have a very lengthy handler, that does certain things, calls other
> handlers, and they in turn call other handlers. This sets up the
> data for the user.
>
> As it takes more than a few seconds, I've created things for the user
> to "do" while waiting.
>
> Is there a built in way for the main handler that sets up the data,
> to pause if the user wants to do something while it's running? And
> then start back up where it left off the minute the user isn't doing
> anything?
I don't believe MC permits simultaneous running of multiple scripts.
That being said, some events can be run while other messages are processed.
Wait and move are a couple of examples.
wait until x = 5 with messages
move grc 1 rel 0,100 without waiting
One way to do what you want might be to place "checkpoints" in your main
handler to check for activity or property/variable change in the second
handler. A simple example:
# IN THE STACK...
on mainHander
attentionCheck
#doStuff1
#doStuff2
attentionCheck
#doStuff3
#doStuff4
attentionCheck
#doStuff5
#doStuff6
end mainHandler
on attentionCheck
if the userNeedsAttention of me then \
wait until not the userNeedsAttention of me with messages
end attentionCheck
# IN A BUTTON OR OTHER CONTROL ACCESSIBLE BY THE USER...
on mouseDown
set the userNeedsAttention of this stack to true
# doUserStuff
end mouseDown
The efficiency of this may be questionable depending on what's being
processed. It would help to know what you're doing when setting up data
that takes long enough to justify preoccupying the user.
Regards,
Scott
_____________________________________________________________________
Scott Rossi Tactile Media - Multimedia & Design
Creative Director Email: scott at tactilemedia.com
Web: http://www.tactilemedia.com
_______________________________________________
metacard mailing list
metacard at lists.runrev.com
http://lists.runrev.com/mailman/listinfo/metacard
More information about the metacard
mailing list