<div dir="ltr"><div dir="ltr">On Wed, Sep 4, 2024 at 10:27 AM Juan Vuletich <<a href="mailto:juan@cuis.st">juan@cuis.st</a>> wrote:<br></div><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"><u></u>
<div bgcolor="#ffffff">
On 9/1/2024 6:03 PM, Mark Volkmann via Cuis-dev wrote:
<blockquote type="cite">
<div dir="ltr">In the Todo app I created in order to learn more
about Morphic, I needed to execute some code when the extent of
<font face="monospace">PluggableScrollPane</font> is changed.
The code changes the size of the "scroller" morph associated
with the PluggableScrollPane. Here's a snippet this shows how I
use it:
<div><br>
</div>
<div><font face="monospace">scrollPane onExtentChanged: [
:newExtent |<br>
todosPane morphWidth: (scrollPane hScrollBarWidth - 10).<br>
].</font></div>
<div><br>
</div>
<div>To achieve this, I created a subclass of <font face="monospace">PluggableScrollPane</font> that adds the <font face="monospace">onExtentChanged: </font>method.</div>
<div><br>
</div>
<div>The attached ChangeSet adds this capability to <font face="monospace">PluggableScrollPane</font> so
it's unnecessary to create a subclass. It does three things:</div>
<div><br>
</div>
<div>- adds the instance variable <font face="monospace">onExtentChanged</font></div>
<div>- adds the instance method <font face="monospace">extendChanged:</font>
to set that instance variable to a block</div>
<div>- adds the following line to the end of the existing <font face="monospace">extentChanged:</font> method</div>
<div><br>
</div>
<div><font face="monospace"> onExtentChanged ifNotNil: [
onExtentChanged value: self morphExtent ].<br clear="all">
</font></div>
</div>
</blockquote>
<br>
Interesting experiment. I'd say the same effect should be possible
by implementing #adjustExtent in the todosPane object, and that it
would be better style.<br>
</div></blockquote></div><div><br></div>Sorry it took me so long to get back with you on this. I was out on vacation.<div><br></div><div>Previously todosPane was a LayoutMorph. I created the class TodosPane as a subclass of LayoutMorph and made todosPane be an instance of that. This works, but perhaps is not what you had in mind.</div><div><br></div><div>TodosPane has the following class method:</div><div><br></div><div><font face="monospace">new<br> ^ self newColumn</font></div><div><br></div><div>TodosPane has the following instance methods:</div><div><br></div><div><font face="monospace">initialize<br> super initialize.<br> self useEdgeSpace: false.<br> self adjustExtent.<br> self color: Color transparent.</font><br><div><br></div><div><font face="monospace">adjustExtent<br> owner ifNotNil: [ self morphWidth: owner viewableWidth ]</font><br></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></div>