[Cuis-dev] LayoutMorph color

Mark Volkmann r.mark.volkmann at gmail.com
Wed Aug 7 16:42:28 PDT 2024


Thanks so much for this fix!

I have a related question. I have a class that is a subclass of LayoutMorph.
Where is the best place to configure the direction to be #vertical?
My initialize instance methods creates and adds a bunch of submorphs.
I added this immediately after "super initialize" in my initialize method:

  self direction: #vertical.

I also tried adding this:

  self beColumn.

I execute this in a Workspace: TodoApp new openAtCursor.
But the direction used is still #horizontal, so my change to the direction
didn't take effect for some reason.

On Wed, Aug 7, 2024 at 2:57 PM Juan Vuletich <juan at cuis.st> wrote:

> 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 Vuletichcuis.stgithub.com/jvuletichresearchgate.net/profile/Juan-Vuletichindependent.academia.edu/JuanVuletichpatents.justia.com/inventor/juan-manuel-vuletichlinkedin.com/in/juan-vuletich-75611b3twitter.com/JuanVuletich
>
>

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


More information about the Cuis-dev mailing list