Morphs differ based on how brought to life?

Dan Shafer dshafer at yahoo.com
Sun Mar 25 05:49:05 UTC 2001


--- Bijan Parsia <bparsia at email.unc.edu> wrote:
> On Sun, 25 Mar 2001, Bijan Parsia wrote:
> [snip]
> > If you look at the #makeControls method, you'll see things like:
> > 
> > 		b _ SimpleButtonMorph new target: self;
> > 				 borderColor: #raised;
> > 				 borderWidth: 2;
> > 				 color: color.
> > Make sure you get the target: self in there.

I added that.

> I reiterate, and maybe repeat ned, inspect your button and see what the
> target is (i.e., what's in the "target" ivar). See what happens if you
> send your message to *that*. (I.e., simulated by hand what's supposed to
> happen when you click the button.)

self is a ScorePlayer. Not a ScorePlayerMorph (which is what I'd have expected
given that I'm defining the method in that class) or a button (which I
understand not to expect). So I examine the rest of the code in makeControls
and I find that wherever it sets the target to self, the actionSelector is set
to a method defined in ScorePlayer rather than in ScorePlayerMorph.

So what I'm missing -- at the very least -- is the connection between
ScorePlayer and the ScorePlayerMorph. Why would a method defined in SPM (tired
of typing the full name) have a "self" that refers, not to the SPM but to the
SP? That just doesn't make sense to me, particularly when the two classes are
in completely different hierarchies.

I'm now officially more confused than before, but I aprpeciate your patience,
Randal and Bijan.

> Cheers,
> Bijan Parsia.
> 


__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/





More information about the Squeak-dev mailing list