[Cuis-dev] PluggableScrollPane scroller width

Mark Volkmann r.mark.volkmann at gmail.com
Sat Aug 17 12:11:00 PDT 2024


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/571d8967/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ProportionalWidthIssue.st
Type: application/octet-stream
Size: 1231 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240817/571d8967/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot 2024-08-17 at 2.08.58?PM.png
Type: image/png
Size: 5393 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240817/571d8967/attachment.png>


More information about the Cuis-dev mailing list