[Newbies] How do you find which code runs when you click on something?

David Mitchell david.mitchell at gmail.com
Thu Jun 28 02:14:52 UTC 2007

Others gave the general approach and how to easily add code to menus.

I also tear apart menus, like you describe. Here's what I do:

Explore morph and then look at target, selector, and arguments. Usually 
the selector is doMenuItem:with: and the arguments have the menu item 
and a symbol that becomes the message send. Check implementors of the 

Also, since most of the UI is "translated" you can find most of the 
messages that build the UI by looking at senders (alt+n) of translated.

Ian Oversby wrote:

> Hi,
> I'm trying to find out which code is run when I click on something
> in Squeak.  I've tried selecting the menu from the middle button
> and then selecting debug -> explore morph.  Is this the best
> way?  Does it work for all morphs?  How can I add new menu
> items which run arbitrary code?
> Thanks,
> Ian
> _______________________________________________
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners

More information about the Beginners mailing list