[Cuis-dev] LayoutMorph color

ken.dickey at whidbey.com ken.dickey at whidbey.com
Sun Aug 4 15:52:51 PDT 2024


On 2024-08-04 13:13, Mark Volkmann via Cuis-dev wrote:

> 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.

Then again, you could override the method that is giving you grief..

YourLayoutMorph class>>new
	^super newRow color: Color yellow


More information about the Cuis-dev mailing list