Mantis - Squeak
Viewing Issue Advanced Details
1404 Morphic minor always 07-02-05 00:37 08-22-07 05:11
new 3.8  
0001404: [Bug] The ever-widening PluggableTextMorph
( PluggableTextMorph
    on: nil
    text: nil
    accept: nil
    readSelection: nil
    menu: nil )
    extent: 50@100;
    editString: 'This is some really long text that will hopefully cause
the PTM to wrap and a scollbar appear';
    hResizing: #shrinkWrap;

Now either extend the text or just wiggle the scrollbar and watch the
PluggableTextMorph widen and widen. The hResizing: #shrinkWrap seems to
lead to this behaviour.
child of 0006635new  Mother of Squeak UI annoyances 

07-02-05 00:39   
"frits.swinkels" <>:

"The following code has the same problem:
(PluggableListMorph on:
#(A b c d e f g h i j k l)
list: #contents selected: nil changeSelected: nil)
color: Color green;
hResizing: #shrinkWrap;
fullBounds ;

replace the normal wondow building method in ObjectExplorer with the
explorerFor: anObject
    | listMorph |
    rootObject _ anObject.

    (listMorph _ SimpleHierarchicalListMorph
            on: self
            list: #getList
            selected: #getCurrentSelection
            changeSelected: #noteNewSelection:
            menu: #genericMenu:
            keystroke: nil).

    listMorph autoDeselect: false; hResizing: #shrinkWrap.

or introduce hResizing: #shrinkWrap in the original method. Open it on
Smalltalk, expand it and move the scrollbar to see utter confusion!

These are all subclasses of scrollpane, but I have not tested
AlansTextPlusMorph, the only other subclass.

For the morphs under discussion, it should be noted that innerBounds is
calculated to be bounds minus the scrollbar: innerBounds is used to set
the extent of the scroller, the scrolling pane.In the method
Morph>>adjustLayoutBounds there is first a correction to the width when
hResizing = #shrinkWrap and then later -in Morph>>layoutBounds: the same
correction is made once more. innerbounds figures in those calculations
directly or indirectly.

Possible fixes (e.g.don't use #shrinkWrap or disable/change
ScrollPane>>adjustLayoutBounds) don't really answer your or my
questionas to why it was designed that way. In a sense, shrinkWrap does
not make sense for the PluggableTextMorph and friends, because they are
shrinkwrap by design: the inner text pane is calculated by the PTM to
fill itself!"