[Cuis-dev] Show Morphs halos from object explorer
Juan Vuletich
juan at jvuletich.org
Tue Jun 29 07:54:07 PDT 2021
Hi Mariano,
On 6/29/2021 10:10 AM, Mariano Montone via Cuis-dev wrote:
> Hello,
>
> when debugging my Morphic GUI I miss the ability to show a Morph's halos
> from the Smalltalk explorer. The Smalltalk explorer let's me explore a
> Morph's owner and submorphs, but being able to show the current selected
> item halos would be very handy (I can inspect selected Morph size and
> position like that).
>
> So I added it, like this in ObjectExplorerWindow>>genericMenu :
>
> model getCurrentSelection ifNotNil: [ :currSel |
> (currSel item isKindOf: Morph) ifTrue: [
> aMenu addLine.
> aMenu add: 'show morph halo' target: currSel item action: #addHalo]].
>
> I attach the file with the change.
I pushed your code to GitHub, with a small change: In Cuis we generally
prefer to ask #is: and not #isKindOf: . It is generally faster, but also
gives the object the opportunity to define itself if to be included in
some protocol / category / grouping of objects, instead of using a
rigid, system enforced criterion.
> Even better than that would be to let the current selected model
> participate in the building of the explorer menu, but I guess that would
> be another story.
Yes. That is a good idea. I guess that Object could answer #() to
something like #inspectorMenuOptions, and each class could add its own.
This should be used both for inspectors and explorers, and integrated in
#fieldListMenu , including what currently is at
#addItemsFromDictionaries: , #suggestObjectSpecificMenuItemsFor: , etc.
> Any thoughts?
>
> Thanks,
>
> Mariano
Thanks,
--
Juan Vuletich
www.cuis-smalltalk.org
https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
https://github.com/jvuletich
https://www.linkedin.com/in/juan-vuletich-75611b3
@JuanVuletich
More information about the Cuis-dev
mailing list