<div dir="ltr">The feedback from Ken and Mariano helped a lot!<div><br><div>I did not know that LayoutSpecs are ignored if they are on a Morph that is not owned by a LayoutMorph, so that was great to learn.</div><div><br></div><div>I came up with a solution. Does this seem acceptable?</div><div>I created a subclass of <font face="monospace">PluggableScrollPane</font> that holds an <font face="monospace">onExtentChanged</font> block instance variable</div><div>and I overrode the <font face="monospace">extentChanged:</font> method like this:</div><div><br></div><div><font face="monospace">extentChanged: oldExtent<br> super extentChanged: oldExtent.<br> onExtentChanged ifNotNil: [ onExtentChanged value: self morphExtent ].</font><br></div><div><br></div><div>This allows me to listen for changes to the extent of my <font face="monospace">PluggableScrollPane</font> subclass where I can do this:</div><div><br></div><div><font face="monospace">psp onExtentChanged: [ :newExtent |<br> todosPane morphExtent: (psp hScrollBarWidth - 10) @ </font>todosPane morphExtent y<font face="monospace">.<br> ].</font><br></div><div><font face="monospace"><br></font></div><div><font face="monospace">todosPane</font><font face="arial, sans-serif"><span class="gmail-Apple-converted-space"> </span>is the "scroller" set on the<span class="gmail-Apple-converted-space"> </span></font><font face="monospace">PluggableScrollPane.</font></div><div><font face="arial, sans-serif">Not sure why I need the minus 10, but without that a horizontal scrollbar appears.</font></div><div><font face="arial, sans-serif">This works perfectly! Now the contents of the </font><font face="monospace">PluggableScrollPane</font><font face="arial, sans-serif"> resizes when its size changes.</font></div></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">The attached screenshot shows the current state of my Todo app.</font></div><div><font face="arial, sans-serif">This has been a great learning exercise.</font></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Aug 17, 2024 at 6:00 PM Mariano Montone via Cuis-dev <<a href="mailto:cuis-dev@lists.cuis.st">cuis-dev@lists.cuis.st</a>> wrote:<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"><u></u>
<div>
<p>Adjust the width of the scroller morph:</p>
<p>psp scroller morphWidth: 180.</p>
<p>Note that that width will not adjust dynamically (as you change
the morph extent of the whole morph).</p>
<p><br>
</p>
<div>El 17/8/24 a las 16:11, Mark Volkmann
via Cuis-dev escribió:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div dir="ltr">Added example code at bottom of this email ...</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Fri, Aug 16, 2024 at
1:16 PM Mark Volkmann <<a href="mailto:r.mark.volkmann@gmail.com" target="_blank">r.mark.volkmann@gmail.com</a>>
wrote:<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">
<div dir="ltr">I have the following Morph containment
hierarchy:
<div><br>
</div>
<div>- PluggableScrollPane</div>
<div> - LayoutMorph newColumn</div>
<div> - a bunch of LayoutMorph newRow</div>
<div><br>
</div>
<div>All of these have their layoutSpec proportionalWidth
set to 1.</div>
<div>When I run my app, the PluggableScrollPane width is
stretched to match the width of its parent.</div>
<div>But the other morph widths are not stretched to match
that width.</div>
<div>Is there something extra I need to send to
my PlugglableScrollPane to tell it that the width of the
assigned "scroller" (my LayoutMorph newColumn) should
have its width stretched?</div>
</div>
</blockquote>
<div><br>
</div>
<div>To demonstrate the issue, I created the class <font face="monospace">ProportionalWidthIssue</font>. A
screenshot of the result and a fileOut are attached.</div>
<div>The question is why the width of <font face="monospace">column</font>
doesn't expand to fill the <font face="monospace">PluggableScrollPane</font>.</div>
<div><br>
</div>
<div>This class is a subclass of <font face="monospace">Object</font>
and only has the following instance methods.</div>
<div><br>
</div>
<div><font face="monospace">initialize<br>
| column psp |<br>
<br>
</font><span style="font-family:monospace"> <span> </span></span><font face="monospace">column := LayoutMorph newColumn.<br>
</font><span style="font-family:monospace"> <span> </span></span><font face="monospace">column layoutSpec proportionalWidth: 1.<br>
</font><span style="font-family:monospace"> <span> </span></span><font face="monospace">column addMorph: (self makeRow: #('One'
'Two')).<br>
</font><span style="font-family:monospace"> <span> </span></span><font face="monospace">column addMorph: (self makeRow: #('Three'
'Four')).<br>
</font><span style="font-family:monospace"> <span> </span></span><font face="monospace">column addMorph: (self makeRow: #('Five'
'Six')).<br>
</font><span style="font-family:monospace"> <span> </span></span><font face="monospace">column addMorph: (self makeRow: #('Seven'
'Eight')).<br>
</font><span style="font-family:monospace"> <span> </span></span><font face="monospace">column addMorph: (self makeRow: #('Nine'
'Ten')).<br>
<br>
</font><span style="font-family:monospace"> <span> </span></span><font face="monospace">psp := PluggableScrollPane new.<br>
</font><span style="font-family:monospace"> <span> </span></span><font face="monospace">psp morphExtent: 200 @ 70.<br>
</font><span style="font-family:monospace"> <span> </span></span><font face="monospace">psp scroller: column.<br>
</font><span style="font-family:monospace"> <span> </span></span><font face="monospace">psp openInHand.<br>
</font></div>
<div><font face="monospace"><br>
</font></div>
<div><font face="monospace">makeRow: anArray<br>
</font><span style="font-family:monospace"> <span> </span></span><font face="monospace">| row |<br>
</font><span style="font-family:monospace"> <span> </span></span><font face="monospace">row := LayoutMorph newRow color: Color
white.<br>
</font><span style="font-family:monospace"> <span> </span></span><font face="monospace">row layoutSpec proportionalWidth: 1.<br>
</font><span style="font-family:monospace"> <span> </span></span><font face="monospace">anArray withIndexDo: [ :element :index |<br>
</font><span style="font-family:monospace"> <span> </span></span><span style="font-family:monospace"> </span><span style="font-family:monospace"> </span><span style="font-family:monospace">| label |</span></div>
<div><span style="font-family:monospace"> </span><span style="font-family:monospace"> </span><span style="font-family:monospace"> </span><span style="font-family:monospace"> </span><span style="font-family:monospace">label := LabelMorph
contents: element.</span></div>
<div><span style="font-family:monospace"> </span><span style="font-family:monospace"> </span><span style="font-family:monospace"> </span><span style="font-family:monospace"> </span><span style="font-family:monospace">index = 1 ifTrue: [ label
layoutSpec proportionalWidth: 1 ].</span></div>
<div><span style="font-family:monospace"> </span><span style="font-family:monospace"> </span><span style="font-family:monospace"> </span><span style="font-family:monospace"> </span><span style="font-family:monospace">row addMorph: label.</span></div>
<div><span style="font-family:monospace"> <span> </span></span><font face="monospace">].<br>
</font><span style="font-family:monospace"> <span> </span></span><font face="monospace">^ row</font><br>
</div>
<div><br>
</div>
<div>A fileOut is attached. To see the issue, enter</div>
<div><font face="monospace">ProportionalWidthIssue new</font></div>
<div>in a Workspace and "Do It". </div>
</div>
<div><br>
</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>
<br>
<fieldset></fieldset>
</blockquote>
</div>
-- <br>
Cuis-dev mailing list<br>
<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank">Cuis-dev@lists.cuis.st</a><br>
<a href="https://lists.cuis.st/mailman/listinfo/cuis-dev" rel="noreferrer" target="_blank">https://lists.cuis.st/mailman/listinfo/cuis-dev</a><br>
</blockquote></div><br clear="all"><div><br></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>