[Cuis-dev] my first submitted change set

Juan Vuletich juan at cuis.st
Wed Sep 4 08:27:09 PDT 2024


On 9/1/2024 6:03 PM, Mark Volkmann via Cuis-dev wrote:
> In the Todo app I created in order to learn more about Morphic, I 
> needed to execute some code when the extent of PluggableScrollPane 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:
>
> scrollPane onExtentChanged: [ :newExtent |
>     todosPane morphWidth: (scrollPane hScrollBarWidth - 10).
> ].
>
> To achieve this, I created a subclass of PluggableScrollPane that adds 
> the onExtentChanged: method.
>
> The attached ChangeSet adds this capability to PluggableScrollPane so 
> it's unnecessary to create a subclass. It does three things:
>
> - adds the instance variable onExtentChanged
> - adds the instance method extendChanged: to set that instance 
> variable to a block
> - adds the following line to the end of the existing extentChanged: method
>
>  onExtentChanged ifNotNil: [ onExtentChanged value: self morphExtent ].

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.

> Does this seem worthy of adding to PluggableScrollPane?
>
> -- 
> R. Mark Volkmann
> Object Computing, Inc.

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.

Thanks,

-- 
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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240904/83d35466/attachment.htm>


More information about the Cuis-dev mailing list