[resent due to attachment limit, sorry for the delay!]


Hi Timothy,


not sure if your question has already been answered, but maybe this approach can help you in general to find answers to problems like these. Let's dive into some reverse engineering tools of Squeak!


First, start a normal System Browser and open the halo on the message category list:

Then open its debug menu by clicking the wrench icon and choose "browse action code":
And you get the method which the list is configured to call in order to get its contents:
 
By selecting #rawMessageCategoryList and pressing <cmd>m, you also get the second screenshot where you can see that your desired method is named #categories. Select #classOrMetaClassOrganizer and press <cmd>m again to find out where the organizer comes from:

Okay, this is stored as an instance variable, but how is it set? Right-click the message from the list and choose "assignments..." (you can also do this in any class browser, btw). Next, select classOrganizer from the list.

And you will find:


So your script might look like this: MyClass organization categories.

I hope this might help you to answer future questions! And please forgive me if I told you something you already knew :-)
Have a nice time with Squeak!

Best,
Christoph


Von: Beginners <beginners-bounces@lists.squeakfoundation.org> im Auftrag von tty <gettimothy@zoho.com>
Gesendet: Mittwoch, 15. Januar 2020 20:26 Uhr
An: beginners@lists.squeakfoundation.org
Betreff: [Newbies] code to retrieve all method categories and methods under a category
 
Hi All.

I want to dynamically build a drop-down menu in Seaside based on the
instance side methods I have in a class.

#MyClass has method categories: "Attributes Links Paragraph....etc"
Under Method category Links are  methods #testLinkCategory,
testLinkExternal, testLink....etc.

I have been hunting for over an hour and I see no obvious way to retrieve
this info (I have found a way to get all the methods, but not the category
that houses them.


The code I have in mind has form:

*categories := categoriesFor: #MyClass.

categories do:[:cat | |methods|
             methods :=  methodForClass:#MyClass category: cat.
             methods do:[:m |
                             "dynamically build my html here"
]]l*


Any help much appreciated.

thx



--
Sent from: http://forum.world.st/Squeak-Beginners-f107673.html
forum.world.st
Squeak - Beginners forum and mailing list archive. This list is the place to ask all the "simple" questions you as a newcomer to squeak always wanted to ask.


_______________________________________________
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners