<div dir="auto"><div dir="ltr">Mariano and Gerald, thanks. a lot. It's not in. my muscle memory but, thanks to your explanations, I was able to go from question (where does this come from?) to relevant method code in 5 steps:<div><br></div><div>1. halo down to morph of interest</div><div>2. halo > menu > debug > "browse morph class"</div><div>3. hierarchy browser for class in question</div><div dir="auto">4. Identify class and method nearest to client class</div><div dir="auto">5. explore call chain if method code does not correspond to manifestation you were interested in</div><div dir="auto"><br></div><div dir="auto">I wrote the last 2 steps away from my desk, from memory. I might come back to refine them.</div><div dir="auto"><br></div><div dir="auto">But thanks a lot, I feel winglets growing on my back  🙂</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Mar 18, 2023 at 7:28 AM Gerald Klix <<a href="mailto:cuis.01@klix.ch" target="_blank" rel="noreferrer">cuis.01@klix.ch</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Please see below.<br>
<br>
On 3/18/23 1:55 AM, Alexandre Rousseau wrote:<br>
> I need to pick someone's brains.<br>
><br>
> I'm trying to find the code (for purposes of theming) used to build<br>
> this row of browser buttons (see attached).<br>
><br>
> I doubt that clicking on every selector and reading its code in the hope of<br>
> landing on the answer -- as I have done -- is the most efficient way.<br>
It normally is, but not in this case.<br>
> If you wanted to find the code that built this row of buttons, what tool(s)<br>
> or actions would you take?<br>
I don't remember what I did to find that code, AFAIR I opened<br>
about 100 hundred method browsers with senders and implementors,<br>
at least it felt that way.<br>
<br>
I started with BrowserWindow>>#buildMorphicWidget and<br>
looked at the implementation of the various #buildSuchAndSuch<br>
message sends. After some search I came across #buildLowerPanes,<br>
which contains a message send of #optionalButtonRow. This method<br>
in turn creates all the PluggableButtonMorph instances from the<br>
result of #optionalButtonTuples. The later being the method to look at.<br>
That's the generic and tedious Smalltalk approach.<br>
<br>
A slightly faster approach is to browse PluggableButtonMorph.<br>
The ClassList-menu provides an option named "class refs (N)",<br>
that opens a method browser on all the references of<br>
PluggableButtonMorph. In this window you may find<br>
CodeWindow>>#optionalButtonRow, provided you are aware that<br>
BrowserWindow is a subclass of CodeWindow. This approach should<br>
also work with every Smalltalk.<br>
<br>
The fastest approach is to make use Morphic's introspection<br>
capabilities. Shift-Middle-Click on one of the buttons, say<br>
"Implementors", in the morphic halo, press the explore button, right<br>
below the halo's close button. An explorer will open. In this<br>
explorer you will find the buttons instance variable named<br>
actionSelector. It is bound to #browseMessages.<br>
Now comes the critical part: Find the implementation of<br>
#browseMessages. You use "WorldMenu -> Open -> Message Names" to<br>
search for it. This will open a method browser with one result:<br>
CodeWindow>>#browseMessages. You use that browser window to<br>
find the senders of #browseMessages. This will yield three<br>
senders of which one is CodeWindow>>#optionalButtonRow.<br>
<br>
Tip: As you can see by looking at the code of CodeWindow>>#optionalButtonRow<br>
"Senders" and "Implementors" have a so called secondary selector,<br>
which is invoked when you press a button morph with the right mouse button.<br>
In the case of "Senders" it directly opens a method browser for the<br>
senders of the method you browse, without opening a menu of<br>
all message sends. You can also right click on the "Browse" and<br>
"Inheritance", which opens a full browser or inheritance browser<br>
like the left click on that button, but it also closes the existing<br>
browser window after placing the new window at the same<br>
location the old window occupied. In a nutshell: You can<br>
virtually convert a Browser to an Inheritance Browser<br>
or a Method Browser to a (Full) Browser with one mouse click.<br>
<br>
I suppose this is not documented in the the Cuis book,<br>
because the lazy author of these short cuts, namely me,<br>
did not do it, sorry.<br>
<br>
<br>
HTH,<br>
<br>
Gerald<br>
<br>
><br>
> [image: Screenshot 2023-03-17 at 8.49.11 PM.png]<br>
><br>
> On Fri, Mar 17, 2023 at 12:52 PM Alexandre Rousseau <<a href="mailto:yalexr@gmail.com" target="_blank" rel="noreferrer">yalexr@gmail.com</a>><br>
> wrote:<br>
><br>
>> Thanks !<br>
>><br>
>> I'm rather new at this but I will try. News apace.<br>
>><br>
>> On Fri, Mar 17, 2023 at 12:48 PM Gerald Klix <<a href="mailto:cuis.01@klix.ch" target="_blank" rel="noreferrer">cuis.01@klix.ch</a>> wrote:<br>
>><br>
>>> Hi Alexandre,<br>
>>><br>
>>> Subclassing BrowserWindow and PluggableButtonMorph is one possible<br>
>>> solution.<br>
>>><br>
>>> The other solution is to provide a proper change set for the base image,<br>
>>> containing the added preference and the changed PluggableButtonMorph<br>
>>> code. I presume that this is a rather simple change, meaning it does not<br>
>>> create a big review effort for Juan, therefore he might accept such a<br>
>>> change.<br>
>>> I am strongly in favor of such a solution, because I want a better<br>
>>> contrast<br>
>>> of the buttons wrt. to the window background.<br>
>>><br>
>>> While you are at it, you may also try to unify the code that calculates<br>
>>> the color of the browser's inheritance button and the code that calculates<br>
>>> the color of this very button's balloon help. The balloon help code<br>
>>> is a rather bad hack (of mine).<br>
>>><br>
>>><br>
>>> HTH and Best Regards,<br>
>>><br>
>>> Gerald<br>
>>><br>
>>><br>
>>> On 3/17/23 2:23 PM, Alexandre Rousseau via Cuis-dev wrote:<br>
>>>> Hi.<br>
>>>><br>
>>>> I'm subclassing ClassicTheme to define my own theme, drawing examples<br>
>>> from<br>
>>>> ClassicTheme and its parent class (Theme).<br>
>>>><br>
>>>> I now want to customize the colors of Browser buttons (instances of<br>
>>>> PluggableButtonMorph), i.e., I do not want their background color to be<br>
>>>> taken from the defaultWindowColor theme variable, but rather from a new<br>
>>>> one, say, defaultButtonBackgroundColor.<br>
>>>><br>
>>>> Does this imply that I have to subclass Browser and<br>
>>> PluggableButtonMorph,<br>
>>>> or is there a more expedient solution?<br>
>>>><br>
>>>> Thanks!<br>
>>>><br>
>>>> [image: Screenshot 2023-03-17 at 9.16.26 AM.png]<br>
>>>><br>
>>>><br>
>>><br>
<br>
</blockquote></div>