PluggableButtonMorph selector with Argument?
Bijan Parsia
bparsia at email.unc.edu
Thu Feb 14 15:54:53 UTC 2002
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.
More information about the Squeak-dev
mailing list
|