touchesA: (Does anyone think it works?)

Jerry Balzano gjbalzano at ucsd.edu
Wed Feb 20 20:09:03 UTC 2002


I too wondered about "touchesA", and I couldn't even get it to work
consistently with SketchMorphs, Bob Arning's post of 1/29/02 to the
contrary.

I did manage to track down something however.  This is what I did:

I created a SketchMorph and called it "Blob".  I then created another
SketchMorph and called it "StarSketch".

I created a script for Blob consisting of a Test: the Test was whether the
Blob touchesA StarSketch.  If Yes, then Blob should make the "croak" sound.

I then dragged the Blob on top of the StarSketch and fired the script.  It
did not work!

After a number of unsuccessful and therefore inconsequential variations, I
happened to create a duplicate of the StarSketch (using the green
"duplicate" handle on its halo).  I added another Test to my script: the
Test was the (built-in) test for whether the StarSketch touchesA
StarSketch.  If Yes, then StarSketch should make the "clink" sound.

I then dragged StarSketch over its duplicate, StarSketch1, and fired the
script.  Clink!

Dragged the Blob over StarSketch1, fired the script.  Croak!

But Blob over original StarSketch ... nothing.

This can't be the intended behavior of touchesA, can it?  Is there
something obvious (or nonobvious) that I'm missing, or is this a bug?

						- Jerry

P.S. For the record, here is the textual code for the script:
script1
	(self touchesA: StarSketch)
			~~ false
		ifTrue: [self beep: 'croak'].
	(StarSketch touchesA: StarSketch)
			~~ false
		ifTrue: [StarSketch beep: 'clink']

P.P.S. Version 3.2gamma-4743 trashes a scriptor if you try to toggle back
and forth between tiles and textual code views of a script.  (I am using a
Mac, System 9.1)





More information about the Squeak-dev mailing list