[Newbies] Re: Parse an argument for a symbol that requires one

Jerome Peace peace_the_dreamer at yahoo.com
Tue Mar 4 06:46:06 UTC 2008

[Newbies] Parse an argument for a symbol that requires

Hi Marcus

To get the best help, please describe the user story.
What are you trying to do?

You can give buttons arguments:
myButton target: aTarget .
myButton actionSelector:  #someAction: .
myButton arguments: Array with: myArgument .
	(You have to change #arguments: when ever the
argument changes.)

or you can use blocks as targets

myButton target: [ aTarget someAction: myArgument ]
actionSelector: value .

where myArgument could be something like
(FillinTheBlank request: 'Eh wot Marcus?')

This all seems a difficult way to achieve something.
Which is why I mention telling the story first. Then
it might be seen if what you want is better achieved
some other way.

Yours in curiosity and service, --Jerome Peace

>Marcus Strehlow marcus.strehlow at gmail.com 
>Mon Mar 3 20:51:44 UTC 2008 
>Hi guys,
>if you have a SimpleButtonMorph, you can decide what
it should do and  
>it's pretty easy. You say
>self target: aTarget
>actionSelector:  #someAction.
>And it works. But what if not only an action should
be executed, what  
>if the actionSelector gets a symbol that requires an
argument? In my  
>case I need to change a variable first before further
proceeding you  
>see. So I am wondering if it is possible to do
something like this:
>self target: aTarget
>actionSelector: #someAction: argumentRequired
>I have tried many ways, including constructing the
action first in  
>temporary variables and then just using that temp
variable as  
>actionSelector string. All my efforts have been in
vain. There is a  
>way to solve this for me, but it would be very
tedious to do and would  
>increase the code volume... and that's not what I
I'm not at all sure what you are describing here.

>If you have any ideas on this, let me know.

Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping

More information about the Beginners mailing list