[UI] how to find button action target?

Ken G. Brown kbrown at mac.com
Fri Apr 11 00:52:05 UTC 2008


At 5:21 PM -0700 4/10/08, Matthew Fulmer apparently wrote:
>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/
>_______________________________________________
>UI mailing list
>UI at lists.squeakfoundation.org
>http://lists.squeakfoundation.org/mailman/listinfo/ui

Thx!

This does what I want for now, also setting the new ChangeSet as current, although any open ChangeSorters will not get updated:

ChangeSet newChanges: (ChangeSorter newChangeSet: 'tmpNewChgSet').

I've found how to update them if I could find the open ChangeSorters...

--
ChangeSorter>>newCurrent
	"make my change set be the current one that changes go into"

	ChangeSet  newChanges: myChangeSet.
	self update.  "Because list of changes in a category may thus have changed"
	self changed: #relabel.	
--

Ken G. Brown


More information about the UI mailing list