[Q] perform: selector

David Faught dave_faught at yahoo.com
Fri Dec 20 16:47:35 UTC 2002


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