<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
On 9/1/2024 6:03 PM, Mark Volkmann via Cuis-dev wrote:
<blockquote
cite="mid:CAFfRWnWyehPQr4odVvLMr9ZxzKRev2v-h6JyEuQSCdno06nGog@mail.gmail.com"
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>
<br>
<blockquote
cite="mid:CAFfRWnWyehPQr4odVvLMr9ZxzKRev2v-h6JyEuQSCdno06nGog@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>
<div>Does this seem worthy of adding to <font
face="monospace">PluggableScrollPane</font>?</div>
<div><br>
</div>
<span class="gmail_signature_prefix">-- </span><br>
<div dir="ltr" class="gmail_signature"
data-smartmail="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>
</blockquote>
<br>
I think adding an instance variable to a core class for every
specific use case is not good, as it would result in a lot of
additional complexity.<br>
<br>
Thanks,<br>
<pre class="moz-signature" cols="72">--
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</pre>
</body>
</html>