[Q] perform: selector

Adrian Lienhard adi at netstyle.ch
Fri Dec 20 19:18:57 UTC 2002


Just having scanned your mail, I estimate that it should say (note the right
parenthese):
self addLabel: (self perform: aSelector) asString.
you may probably want to send the message named aSelector first and then
transform the resulting object to a string.

Adrian

----- Original Message -----
From: "David Faught" <dave_faught at yahoo.com>
To: "Squeak Mailing List" <squeak-dev at lists.squeakfoundation.org>
Sent: Friday, December 20, 2002 5:47 PM
Subject: [Q] perform: selector


> I am trying to make a multipurpose method for attaching labels to
> morphs and am missing some basic understanding or syntax of how to make
> it work in Squeak.
>
> 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?
>
> Thanks for any help you can provide.
>
> I apologize right now for not extensively searching all available
> documents on SmallTalk to find out how to do this, but sometimes it's
> just easier to ask.  It's not like I haven't looked at all, but
> obviously I haven't found the right place to look yet.
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
>




More information about the Squeak-dev mailing list