[squeak-dev] "Resettable" Delay?

Kjell Godo squeaklist at gmail.com
Sun May 19 22:01:11 UTC 2019


It sounds like it wants you to kill the Delay ( and Process? ) or something
and create a new Delay on a replica of the Process ( or this same Process?
) But i am just guessing

On Sat, May 18, 2019 at 22:50 Jim Rosenberg <jr at amanue.com> wrote:

> I'm in the midst of a project in which I'm adding sound to some artistic
> work I've been doing in Squeak for quite a few years now. I want a sound
> to
> be played when (1) the mouse cursor enters a morph which is one of my own
> subclasses of RectangleMorph; and then (2) the mouse cursor becomes
> "quiet". Maybe this is not the right way to do this, but here's how I'm
> thinking of doing it:
>
> On mouseEnter, create a Delay and then fork a process which waits on the
> Delay and plays the sound. (Duration of the Delay is an artistic decision
> based on context.)
>
> On mouseMove, if the Delay is notNil and is being waited on, "reset it".
>
> On mouseLeave, kill the process waiting on the Delay if it hasn't already
> fired.
>
> It looks to me from reading the code (Squeak 4.3) that I can reset the
> Delay using the Delay class method scheduleDelay: -- but [I haven't tried
> it yet ...] this makes me nervous. scheduleDelay: is labelled Private. I
> think that's telling me that calling this method from application code is
> a
> No-no. I'm also nervous about what I might need to do regarding the
> semaphore.
>
> Comments please? Is there an easier way to do this? I need some way to
> reset a Delay that's already being waited on to the original duration.
>
> -Thanks in advance, Jim
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20190519/21e21a1a/attachment.html>


More information about the Squeak-dev mailing list