[squeak-dev] "Resettable" Delay?

K K Subbu kksubbu.ml at gmail.com
Mon May 20 04:02:46 UTC 2019


On 19/05/19 11:20 AM, Jim Rosenberg 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".
Morphs incorporate "liveness" through interaction and built-in timers. 
The section "Adding Liveness" in the article below explains this very well:

  http://coweb.cc.gatech.edu/squeakbook/uploads/morphic.final.pdf

Briefly, in your subclass, override #wantsSteps to control live play.
Send #startStepping in your #mouseEnter handler and #stopStepping it in 
#mouseLeave handler. Use #isStepping to detect if stepping is in progress.

Set your interval in #stepTime and play or stop sound in #step.

HTH .. Subbu


More information about the Squeak-dev mailing list