[squeak-dev] How do I use MenuItemMorph>>#debugAction?
Eduardo Ochs
eduardoochs at gmail.com
Sat Mar 4 02:19:04 UTC 2023
Hi all,
short version of my question:
How do I use MenuItemMorph>>#debugAction?
Now the long version. I was trying to use the debugger to understand
how some "demo morphs" are created, starting by this one:
World -> new morph... -> from alphabetical list -> L-N -> LineMorph
I used the debug tool of the halo to copy the MenuItemMorph of that
menu entry to a globally-acessible place, and then in a workspace I
copied that to a variable local to that workspace called
itemLineMorph. I was playing with that variable, and I did a "browse
protocol" on it and I was reading its results. One of them, that
looked especially interesting, was:
MenuItemMorph >> #debugAction
I tried this,
itemLineMorph debugAction.
and it opens the debugger - really neat! But if I tell the debugger to
"proceed" it halts a few steps ahead, with this error:
UndefinedObject(Object)>>doesNotUnderstand: #hand
TheWorldMenu>>newMorphOfClass:event:
[] in MenuItemMorph>>invokeWithEvent:
CursorWithMask(Cursor)>>showWhile:
MenuItemMorph>>invokeWithEvent:
MenuItemMorph>>doButtonAction
[] in MenuItemMorph>>debugAction
[] in FullBlockClosure(BlockClosure)>>newProcess
the problem is that in
TheWorldMenu>>newMorphOfClass:event:
the argument evt is nil... if I set evt by hand there to a keyboard
event that holds a CR and then tell the debugger to proceed,
everything works - I get a LineMorph on the screen.
So: what is the _right_ way to run MenuItemMorph>>#debugAction? And
what is the right way to write something similar to this,
itemLineMorph debugAction.
but that works out of the box?
Thanks in advance!
Eduardo Ochs
http://anggtwu.net/eev-squeak.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20230303/191aeb97/attachment.html>
More information about the Squeak-dev
mailing list
|