[squeak-dev] Questionable constraint in ProportionalSplitterMorph
Trygve Reenskaug
trygver at ifi.uio.no
Sun Jun 1 19:52:55 UTC 2008
Squeak3.10.gamma.7159, WinXP/SP2
I have a window with four panes:
top left: LayoutFrame fractions: (0 at 0 corner: 0.2 at 0.5)).
top right pane: LayoutFrame fractions: (0.2 at 0 corner: 1 at 0.5).
bottom left pane: LayoutFrame fractions: (0 at 0.5 corner: 0.19 at 1).
bottom right pane: LayoutFrame fractions: (0.19 at 0.5 corner: 1 at 1).
self addPaneSplitters does its impressive magic;
a horizontal pane splitter right across the window at y=0.5
two vertical pane splitters one between top left and top right and
another between bottom left and bottom right.
(The latter two has 'splitsTopAndBottom'=false)
The curious thing is that the two vertical pane splitters are linked;
any one of them cannot be moved past the other one. The constraint is in
these methods
/*ProportionalSplitterMorph>>*/
*normalizedX: x*
^ (x max: self leftBoundary) min: self rightBoundary
*rightBoundary*
^ (self splitterRight ifNil: [self containingWindow
panelRect right] ifNotNil: [self splitterRight left]) - 50
*splitterRight*
| splitters |
splitters _ ((self siblingSplitters select: [:each | each x >
self x]) asSortedCollection: [:a :b | a x < b x]).
^ splitters ifEmpty: nil ifNotEmpty: [splitters first]
*siblingSplitters*
^ self owner submorphsSatisfying: [:each | (each isKindOf: self
class) and: [self splitsTopAndBottom = each splitsTopAndBottom] and:
[each ~= self]]
Does anybody know the motivation for this curious behavior? The easiest
workaround would be to hack *siblingSplitters *to return an empty
collection. Perhaps it would be better with a new preference?
(Subclassing /*ProportionalSplitterMorph*/ does not seem practicable).
I'll be grateful for enlightenment about this curious behavior.
--Trygve
**
--
Trygve Reenskaug mailto: trygver at ifi.uio.no
Morgedalsvn. 5A http://heim.ifi.uio.no/~trygver
N-0378 Oslo Tel: (+47) 22 49 57 27
Norway
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20080601/5a1d5771/attachment.htm
More information about the Squeak-dev
mailing list
|