[Cuis-dev] LayoutMorph color

Mark Volkmann r.mark.volkmann at gmail.com
Sun Aug 4 13:13:27 PDT 2024


When I run the code in the debugger I see this in the class method "new" of
LayoutMorph:

new
    ^self newRow color: `(Color red alpha: 0.2)`

So that explains why the color is a shade of pink. It sends the message
`#color:` to the instance AFTER sending the message `#newRow`.
The `newRow` method calls `initialize` which I override to also send the
message `#color` with my preferred color.
So my color gets replaced by pink due to the order of the calls.
Now I need to find a place other than `initialize` to set the color AFTER
`new` is called.
I suppose one option is to override the `drawOn:` method like this:

drawOn: aCanvas
    self color: Color green.
    super drawOn: aCanvas.

Is that what you recommend?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240804/e9ed8178/attachment.htm>


More information about the Cuis-dev mailing list