How do I output a class/catagory as a '.st' file from code ?

Yoshiki Ohshima Yoshiki.Ohshima at acm.org
Wed Dec 8 18:19:03 UTC 2004


  Aaron,

  Bear in mind that everything in Squeak is written in Squeak.  So,
the answer to this question is:

> Are there methods to enumerate catagories and classes in a catagory ?

  Yes.

-- Yoshiki

-------------------------------
Did you notice that the System Browser does it when you choose
'reorganize' menu item from the system category's context menu?  Since
everything is written in Squeak, the menu item is a part of program.
This means that you can inspect it via the debug halo. (See attached
picture.)  Alt-Click on the 'reorganize' item twice, click on the gray
halo, choose 'inspect morph' and inspect 'arguments' inst var in the
inspector.  Do you see something like '#editSystemCategories'?  Does
it sound suspicious?  If so, double click the word to select it and
press Alt-m (you've figured what Alt-m means by now, right?).  It'll
show you how the Browser does it.  You can explore the system along
this line by using Alt-m and Alt-n and you may come across

	editSelection == #editSystemCategories 
		ifTrue: [^ systemOrganizer printString].

part of Browser>>contents.  This is where it happens.  If you change
the above line to:

	editSelection == #editSystemCategories 
		ifTrue: [self halt. systemOrganizer printString].

and choose the 'reorganize' menu item, you'll see the debugger pop up
and put your hands on the live object bound to 'systemOrganizer', etc,
etc.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: reorganize.png
Type: image/png
Size: 26845 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20041208/b7a933d6/reorganize.png


More information about the Squeak-dev mailing list