[Cuis-dev] PluggableScrollPane scroller width

Mariano Montone marianomontone at gmail.com
Sat Aug 17 15:59:52 PDT 2024


Adjust the width of the scroller morph:

psp scroller morphWidth: 180.

Note that that width will not adjust dynamically (as you change the 
morph extent of the whole morph).


El 17/8/24 a las 16:11, Mark Volkmann via Cuis-dev escribió:
> Added example code at bottom of this email ...
>
> On Fri, Aug 16, 2024 at 1:16 PM Mark Volkmann 
> <r.mark.volkmann at gmail.com> wrote:
>
>     I have the following Morph containment hierarchy:
>
>     - PluggableScrollPane
>       - LayoutMorph newColumn
>         - a bunch of LayoutMorph newRow
>
>     All of these have their layoutSpec proportionalWidth set to 1.
>     When I run my app, the PluggableScrollPane width is stretched to
>     match the width of its parent.
>     But the other morph widths are not stretched to match that width.
>     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?
>
>
> To demonstrate the issue, I created the class ProportionalWidthIssue. 
> A screenshot of the result and a fileOut are attached.
> The question is why the width of column doesn't expand to fill the 
> PluggableScrollPane.
>
> This class is a subclass of Object and only has the following instance 
> methods.
>
> initialize
>     | column psp |
>
> column := LayoutMorph newColumn.
> column layoutSpec proportionalWidth: 1.
> column addMorph: (self makeRow: #('One' 'Two')).
> column addMorph: (self makeRow: #('Three' 'Four')).
> column addMorph: (self makeRow: #('Five' 'Six')).
> column addMorph: (self makeRow: #('Seven' 'Eight')).
> column addMorph: (self makeRow: #('Nine' 'Ten')).
>
> psp := PluggableScrollPane new.
> psp morphExtent: 200 @ 70.
> psp scroller: column.
> psp openInHand.
>
> makeRow: anArray
> | row |
> row := LayoutMorph newRow color: Color white.
> row layoutSpec proportionalWidth: 1.
> anArray withIndexDo: [ :element :index |
> | label |
> label := LabelMorph contents: element.
> index = 1 ifTrue: [ label layoutSpec proportionalWidth: 1 ].
> row addMorph: label.
> ].
> ^ row
>
> A fileOut is attached. To see the issue, enter
> ProportionalWidthIssue new
> in a Workspace and "Do It".
>
> -- 
> R. Mark Volkmann
> Object Computing, Inc.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240817/57234de7/attachment-0001.htm>


More information about the Cuis-dev mailing list