[Cuis-dev] Renaming several fundamental Morph classes

Bernhard Pieber bernhard at pieber.com
Fri Dec 24 02:47:32 PST 2021


Hi Juan,

Here are my two cents:

I first encountered the term widget in the Motif X Windows UI framework. I remember this well because I had to look it up at the time. I learned that in the real world a widget is a component of a window. So the metaphor made sense: Windows and Widgets.

In Morphic we use the terms Windows and Morphs instead:

| suffixes |
suffixes := (Morph allSubclasses collect: [:each | each name
	copyFrom: (each name findLast: [:char | char isUppercase])
	to: each name size]) asBag.
suffixes sortedCounts.

"Base a SortedCollection(47 -> 'Morph' 27 -> 'Window' 1 -> 'Item' 1 -> 'Many' 1 -> 'Bar' 1 -> 'Pane')"
"CorePackages: a SortedCollection(48 -> 'Morph' 30 -> 'Window' 1 -> 'Many' 1 -> 'Pane' 1 -> 'Bar' 1 -> 'Sonogram' 1 -> 'Item')"

So I would avoid using the term widget at all in Cuis as part of class or method names. It could be used in package or class category names as widget library seems to be the most frequently used term for libraries of UI components. The same reasoning applies to the term control, which is used in Windows UI frameworks instead of widget.

To sum up, in my opinion all Morph subclasses should either end with Morph or Window.

As others have suggested I would rename MorphicWidget to RectangularMorph. The existing class comment fits it perfectly then.

Regarding MovableMorph: I see that even with all packages loaded MovableMorph is the only subclass of Morph. So one possibility would be to merge it into Morph. What would be a good example of a sibling class to MovableMorph? If you don’t want to merge it: It has two instance variables: location and layoutSpec, so other names might be PositionableMorph or LayoutableMorph.

Regarding KernelMorph: I would merge it with RectangularMorph. It shares the instance variables extent and color. Then a PasteUpMorph could have a border.

Speaking of PasteUpMorph: I don’t mind the name. PlaygroundMorph would fit the class comment. For me it is an area to freely lay out and move around other morphs, so what about LayoutBoardMorph or shorter BoardMorph?

Regarding WorldMorph: I don’t mind the name. A slightly more understandable name to newcomers might be DesktopMorph.

Cheers,
Bernhard

> Am 21.12.2021 um 20:02 schrieb Juan Vuletich via Cuis-dev <cuis-dev at lists.cuis.st>:
>
> Hi Folks,
>
> It has become apparent that some class names I chose some time ago are
> not meaningful enough. The most confusing is the meaning I assumed for
> "Widget". Decades ago, Widget meant "UI element in some library". Today
> it means "Anything the user can interact with". So, I want to do the
> following renames:
>
> MovableMorph    -> MorphicWidget
> WidgetMorph      -> GUIControlMorph
> KernelMorph       -> SpecialMorph
> WorldMorph        -> MorphicWorld
> PasteUpMorph   -> PlaygroundMorph
>
> I hope these convey meaning more effectively.
>
> There will be impact on some packages. I have changesets ready to be
> applied for all packages in repos in the Cuis-Smalltalk organization.
>
> Before applying all this:
> Do you like the new names? Do you know better ones to suggest?
> Any other thoughts?
>
> Thanks,
>
> --
> Juan Vuletich
> www.cuis-smalltalk.org
> https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
> https://github.com/jvuletich
> https://www.researchgate.net/profile/Juan-Vuletich
> https://www.linkedin.com/in/juan-vuletich-75611b3
> https://independent.academia.edu/JuanVuletich
> @JuanVuletich
>
> --
> Cuis-dev mailing list
> Cuis-dev at lists.cuis.st
> https://lists.cuis.st/mailman/listinfo/cuis-dev




More information about the Cuis-dev mailing list