MenuMorph callback
Bob Arning
arning at charm.net
Fri Jun 28 23:02:11 UTC 2002
Curiously, this is related to a recent discussion about #perform:orSendTo:. What' shappening is that MenuMorph>>setInvokingView: is manipulating your menu entry...
"Re-work every menu item of the form
<target> perform: <selector>
to the form
<target> perform: <selector> orSendTo: <invokingView>.
This supports MVC's vectoring of non-model messages to the editPane."
So if MyClass does not implement #perform:orSendTo:, then it will get the default behavior which is to pass the message to the invoking view (the PluggableListMorph in this case).
You have several choices:
- implement MyClass>>perform:orSendTo: to handle the message
- use a DumberMenuMorph instead of MenuMorph and this problem is avoided
Cheers,
Bob
On Sat, 29 Jun 2002 00:20:19 +0200 Bergel Alexandre <bergel at iam.unibe.ch> wrote:
>I do not understand, I have defined :
>-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=3D-=-=
>MyClass>>getMenu: aMenu
> aMenu defaultTarget: self.
> aMenu
> add: 'showdependancies'
> target: self
> selector: #showDependancies.
> ^ aMenu
>-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=3D-=-=
>
>And when I press the item in my menu, I have a message not understood #showDependancies for the PluggableListMorph related.
>Of course, I have defined the method MyClass>>showDependancies
>
>If anyone has a suggestion...
More information about the Squeak-dev
mailing list
|