[UI] how to find button action target?

Matthew Fulmer tapplek at gmail.com
Fri Apr 11 00:21:34 UTC 2008


On Wed, Apr 09, 2008 at 01:11:32PM -0600, Ken G. Brown wrote:
> Hi, I have a question about where to find what actually gets executed when you click a button.
> sq3.10-7159dev08.04.1 with UI Enhancements
> 
> eg. Open a simple ChangeSorter, opt-click to make a new ChangeSet, enter the name.  What gets done when you click ok?
> I've dragged a copy of the button off and explored and inspected but cannot find what the button action actually is.
> I seem to be missing some key understanding on how the button in this case works.

You started debugging too late. You want to know what the menu
item does, not the dialog box. The dialog box is a generic text
entry box for anything. Here is what I do to find out what menu
items do:

1. Open the change sorter
2. Right-click, and get the context menu
3. Shift-click the entry "new change set... (n)" to edit the
   text of the menu
4. Press Cmd-Shift-E to search for that string in all source
   code
5. This will take you to the place where the menu item is
   defined:

    aMenu add: 'new change set... (n)' action: #newSet.

6. Double-click newSet and press Cmd-m to find implementers of
   #newSet
7. Place a self halt at the beginning of the newSet method, or
   look through it and find more implementers (Cmd-m), or browse
   the class (mouse-over the top pane and Cmd-b)

Once you get this down, you can go from menu item to debugger in
about 20 seconds.

> My goal, and reason for looking into this particular thing, is
> to programmatically create a new ChangeSet in an Installer
> script, so answering how to do that would help too.

ChangeSet newChangeSet: 'KenStuff'

-- 
Matthew Fulmer -- http://mtfulmer.wordpress.com/


More information about the UI mailing list