Squeak Documentation

Lex Spoon lex at cc.gatech.edu
Sun Jun 7 08:28:57 UTC 1998


I guess you'd have to wade through SystemOrganization and
ClassOrganization's.  Looking in the system browser,
SystemOrganization seems to have a listAtCategoryNamed: method which
gives you a list of class names for the given category name.  Then,
you can look up each name in Smalltalk to get the actual classes.  So
it would be something like:

    classNameList := (SystemOrganization listAtCategoryNamed: 'System-Sound' asSymbol).
    classList :=  classNameList collect: [ :name | Smalltalk at: name ].


After you have the classes, you can send them #organization to get a
ClassOrganizer instance for that class, which has things like method
categories and method names.  Here's something vaguely similar to what
you asked for:

    classList do: [ :class |
        Transcript show: 'comment: ', class comment.  Transcript cr.
        organization := class organization.
        organization categories do: [ :categoryName |
            "print the name of the method category"
            Transcript show: categoryName; cr; show: '-------'; cr.

            "print out the method names in that category"
            (organization listAtCategoryNamed: categoryName) do: [ :methName |
                Transcript show: methName; cr. ] ] ]



Hmm, this doesn't print the class definition.  You could look up in
Browser>>contents and see how the system browser obtains this info.

Lex







Martin Pammer writes:
 > Hello Squeakers
 > 
 > Is there a way to extract the following information for a class categorie ?
 > 
 > for all classes in categorie
 >      class definition
 >      class comment
 >      class protocol
 > 
 > Morphic-Kernel
 > -----------------------
 > Morph
 > ----------
 > instanceVariableNames: bounds owner submorphs fullBounds color eventHandler
 >  properties costumee
 > classVariableNames: EmptyArray
 > poolDictionaries: <none>
 > 
 > comment:
 > -----------------
 > A morph (from the Greek "shape" or "form") is an interactive graphical
 > object.
 > 
 > initialization
 > ------------------
 > initialExtent
 > initialize
 > openInMVC
 > openInWorld
 >      "Add this morph to the world.  If in MVC, then provide a Morphic
 > window for it."
 > standardPalette
 >      "Answer a standard palette forced by some level of enclosing
 > presenter, or nil if none"
 > ...
 > accessing
 > ----------------
 > eventHandler
 > eventHandler: anEventHandler
 >      "Note that morphs can share eventHandlers and all is OK.  "
 > rotationDegrees
 > ...
 > 
 > and so on. Has anyone done this already ? If not, I will try to make it ba
 > myself.
 > 
 > Any suggestions ?
 > 
 > With best regards
 > 
 > Martin Pammer
 > VRZ Informatik
 > mpammer at vrz.net
 > 
 > 





More information about the Squeak-dev mailing list