[squeak-dev] How do I use MenuItemMorph>>#debugAction?

Eduardo Ochs eduardoochs at gmail.com
Sat Mar 4 03:28:38 UTC 2023


Hi Vanessa!

First: wow, thanks! I need to use the menu item of the halo more...
will do that!

Second: I've tried the "debug action invocation" option in the halo
menu for this menu item,

  World -> new morph... -> from alphabetical list -> L-N -> LineMorph

and when I clicked "proceed" in the debugger I got exactly the same
error as before, i.e., this,

  UndefinedObject(Object)>>doesNotUnderstand: #hand
  TheWorldMenu>>newMorphOfClass:event:
  [] in MenuItemMorph>>invokeWithEvent:
  CursorWithMask(Cursor)>>showWhile:
  MenuItemMorph>>invokeWithEvent:
  MenuItemMorph>>doButtonAction
  [] in MenuItemMorph>>debugAction
  [] in FullBlockClosure(BlockClosure)>>newProcess

because the argument "evt" in TheWorldMenu>>newMorphOfClass:event: is
nil... but if before clicking on "proceed" I change evt to a CR, then
I don't get any errors, and the LineMorph is created.

Do you think that one of these two methods should be changed?

  TheWorldMenu >> #newMorphOfClass:event:
  MenuItemMorph >> #debugAction

(I am just a newbie 😶)

  Cheers,
    Eduardo


On Fri, 3 Mar 2023 at 23:52, Vanessa Freudenberg <vanessa at codefrau.net>
wrote:

> On Fri, Mar 3, 2023 at 6:19 PM Eduardo Ochs <eduardoochs at gmail.com> wrote:
>
>> Hi all,
>>
>> short version of my question:
>>
>>   How do I use MenuItemMorph>>#debugAction?
>>
>
> If you browse the senders of this, you will see that certain morphs add
> this to their debug menu. One of them is MenuItemMorph.
>
> *buildDebugMenu:* aHandMorph
>     | aMenu |
>     aMenu *:=* super buildDebugMenu: aHandMorph.
>     aMenu addLine.
>     aMenu add: 'browse action code' translated target: self action:
> #browseImplementationOfActionSelector.
>     aMenu add: 'debug action invocation' translated target: self action:
> #debugAction.
>     ^ aMenu
>
> So basically you bring up the halo for a menu item (bring up halo for
> menu, then click again for halo of item), click the red halo handle to get
> the morph's menu:
>
> [image: image.png]
>
> At the bottom of its the debug submenu you will fine the debug action
> entry:
>
> [image: image.png]
>
> Vanessa
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20230304/5487988f/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 71166 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20230304/5487988f/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 139284 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20230304/5487988f/attachment-0003.png>


More information about the Squeak-dev mailing list