[Cuis-dev] LayoutMorph color
Juan Vuletich
juan at cuis.st
Wed Aug 7 12:57:00 PDT 2024
On 8/4/2024 5:13 PM, 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.
Yes. Not helpful, and annoying. Just pushed an update to remove that.
> 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?
No, just use the update I just pushed.
Thanks,
--
Juan Vuletich
cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
linkedin.com/in/juan-vuletich-75611b3
twitter.com/JuanVuletich
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240807/d12ce7a3/attachment.htm>
More information about the Cuis-dev
mailing list