PluggableButtonMorph selector with Argument?

Stephane Ducasse ducasse at iam.unibe.ch
Thu Feb 14 16:31:14 UTC 2002


on 14/02/02 4:54 PM, Bijan Parsia at bparsia at email.unc.edu wrote:

> On Thu, 14 Feb 2002, Stephane Ducasse wrote:
> 
> [snip]
>> Apparently with  PluggableButtonMorph I can specify an action but not
>> arguments for such an action.
>> 
>> Is it correct?
> 
> As far as I can tell with a quick glance, yes.
> 
>> Can somebody indicate me if there exist buttons in Squeak with this
>> functionality?
> 
> My immediate hack is to use a MenuMorph button (i.e., the kind of thing
> you get when you drag a menu item off a menu to make a button). The
> UpdatingMenuItemMorph most definitely lets you specify arguments.
> 
> But it also looks like SimpleButtonMorph let's you specify arguments. That
> may be a better choice (or not!).
> 
> Seems to me that all the Pluggable classes expect you to wrap up their
> actions into a unary selector, perhaps by building a special model if
> needed. Modifying them to (optionally) take arguments seems not too tricky
> (check out performAction; basically add an arguments ivar and lazily fill
> it with an empty array). Given that the style elsewhere is to allow
> messages with arguments, this might be a worthwhile enhancement.
> 
> Cheers,
> Bijan Parsia.
> 
> 
Hi bijan

I made something somehow similar. The point here is that the receiver of the
message is not the morph itsel. Also the arguments of the message should be
calculated at the moment when the action is executed so I provided a block
which should returns the args.

Stef




More information about the Squeak-dev mailing list