[Q] perform: selector

Ned Konz ned at bike-nomad.com
Fri Dec 20 17:15:13 UTC 2002


On Friday 20 December 2002 08:47 am, David Faught wrote:
> There is already an 'addLabel: string' method that works fine, and
> I am defining the method:
>
>   beLabeled: aSelector
>         self addLabel: (self perform: aSelector asString).
>
> and trying to use it as in:
>
>   aMorph beLabeled: #externalName
>
> where I am expecting aMorph to end up with a label containing the
> text returned by the aMorph externalName method.  DOing this line
> results in a "message not understood" error.  What is the right way
> to do this?

David, are you using Connectors still? There isn't a general purpose 
Morph #addLabel: method.

#addLabel: on NCConnectorMorph takes an event, not a string.

If you just want to add a label with an arbitrary string, you could 
use #addLabel:at: or #addLabel:near: and pass the connector's 
midpoint (or end, or whatever) as the point.

-- 
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE




More information about the Squeak-dev mailing list