<div dir="ltr">On Wed, Aug 7, 2024 at 9:17 PM <<a href="mailto:ken.dickey@whidbey.com">ken.dickey@whidbey.com</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">On 2024-08-07 16:42, Mark Volkmann via Cuis-dev wrote:<br>
<br>
> I have a related question. I have a class that is a subclass of <br>
> LayoutMorph.<br>
> Where is the best place to configure the direction to be #vertical?<br>
<br>
Why does<br>
LayoutMorph newColumn<br>
not work for you?<br></blockquote><div><br></div><div>My class is a subclass of <font face="monospace">LayoutMorph</font>, so I'm not sending a <font face="monospace">#new*</font> message to <font face="monospace">LayoutMorph</font> directly. I'm sending <font face="monospace">#new</font> to my own class. </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">What does stepping through with the debugger suggest?<br>
</blockquote></div><br clear="all"><div><div dir="ltr"><div>I see what's happening now. "<font face="monospace">LayoutMorph new</font>" (invoked by sending <font face="monospace">#new</font> to my subclass) sends <font face="monospace">#newRow</font> which sends #initialize AND THEN <font face="monospace">#beRow</font>.</div><div>So changes I make to <font face="monospace">direction</font> in my subclass <font face="monospace">initialize</font> method get overridden by <font face="monospace">beRow</font>.</div><div>This seems similar to the color: issue I had.</div><div>I can fix this by overriding <font face="monospace">new</font> in my subclass like this:</div><div><br></div><div><font face="monospace">new</font></div><div><font face="monospace"> ^ super new beColumn</font></div><div><br></div><div>But the width of my subclass instance gets calculated based on laying out the submorphs as a row and does not get adjusted down when it switches to a column.</div><div>See the attached screenshot. What can I do to force it to recalculate the width?</div><div>I tried the following in my new method, but this didn't fix it:</div><div><br></div><div><font face="monospace">new<br> | instance |<br> </font><span style="font-family:monospace">instance</span><font face="monospace"> := super new beColumn.<br> </font><span style="font-family:monospace">instance</span><font face="monospace"> refreshExtent.<br> </font><span style="font-family:monospace">instance</span><font face="monospace"> layoutSubmorphs.<br> </font><span style="font-family:monospace">instance</span><font face="monospace"> layoutNeeded: true.<br> ^ </font><span style="font-family:monospace">instance</span><br></div><div><br></div>Side note: I see that the <font face="monospace">direction:</font> method in <font face="monospace">LayoutMorph</font> contains the following:<br><br><font face="monospace"> self flag: #jmvVer. "Move to category #accessing"<br></font><div><br></div><div>Is there a reason not to do that now and remove that line?</div><div><br></div></div></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div><font face="arial, helvetica, sans-serif">R. Mark Volkmann</font></div><div><span style="font-size:12.8px"><font face="arial, helvetica, sans-serif">Object Computing, Inc.</font></span></div></div></div></div></div></div></div></div></div>