[Cuis-dev] hole in my Morphic knowledge

Mark Volkmann r.mark.volkmann at gmail.com
Thu Aug 15 13:30:19 PDT 2024


On Thu, Aug 15, 2024 at 8:34 AM Mark Volkmann <r.mark.volkmann at gmail.com>
wrote:

> I was somewhat surprised to learn that LayoutMorph does not implement a
> drawOn: method that sends #drawOn: to each of its submorphs. What is it
> that triggers the submorphs to be drawn? I had assumed that any morph can
> have submorphs, but most morphs (like LabelMorph) do not draw their
> submorphs. Now I'm questioning that assumption.
>

It's more complicated than I had imagined.
Here is my attempt to answer the question ...
How does the message `#drawOn:` get sent to each currently visible morph?

The abstract class `MorphicCanvas` defines the method
`drawCurrentAndSubmorphs`
as `subclassResponsibility`.
The subclasses of `MorphicCanvas` which include
`BitBltCanvas`, `BoundsFinderCanvas`, `HybridCanvas`, and `VectorCanvas`.
all implement the `drawCurrentAndSubmorphs` method.

The `MorphicCanvas` method `fullDraw:`
sends the message `#drawCurrentAndSubmorphs` to
an instance of one of these `MorphicCanvas` subclasses.
The `drawCurrentAndSubmorphs` method
sends the message `#drawOn:` to the current morph and
sends the message `#fullDraw` to each submorph.

The sequence of message sends that lead to the first call to `fullDraw:` is:

- `UISupervisor class newUIProcess`
- `UISupervisor class spawnNewMorphicProcessFor:`
- `WorldMorph runProcess`
- `WorldMorph mainLoop`
- `WorldMorph displayWorldOn:`
- `MorphicCanvas drawWorld:repair: calls`
- `MorphicCanvas drawRoots:rootsDamage:backgroundDamage:`
- `MorphicCanvas fullDraw:`

-- 
R. Mark Volkmann
Object Computing, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240815/f8d2c5d0/attachment.htm>


More information about the Cuis-dev mailing list