[squeak-dev] SystemsWindow color mixup
Trygve Reenskaug
trygver at ifi.uio.no
Thu Aug 21 10:57:12 UTC 2008
Squeak3.10.gamma.7159
The following code gives surprising results:
--
/ | window pasteUpMorph |
(pasteUpMorph := PasteUpMorph new) color: Color green.
window := SystemWindow new.
window addMorph: pasteUpMorph frame: (0 at 0.1 corner: 1 at 1).
window openInWorld./
--
The result is a SystemsWindow with all submorphs green except the
pasteUpMorph, which is white!
The offending statements are in SystemWindowaddMorph: aMorph fullFrame:
aLayoutFrame
/aMorph adoptPaneColor: self paneColor.
aMorph borderWidth: 1; borderColor: Color lightGray; color: Color white.
self paneColor/ has surprising side effects.
- It sets set the SystemsWindow property: paneColor->pasteupMorph
color. (i.e., green)
- It sets the color of all SystemsWindow submorphs to the new
color (i.e. green)
/aMorph borderWidth: 1; borderColor: Color lightGray; color: Color white.
/simply sets the color of the pasteUpMorph to white.
The result is that /ScrollPane>>example1/ and any other simple use of
/ScrollPane /don't work properly.
I fixed the problem by setting the SystemWindow>>paneColor early:
/ // | window pasteUpMorph |
(pasteUpMorph := PasteUpMorph new) color: Color green.
window := SystemWindow new./
_/window paneColor: Color white./_
/ window addMorph: pasteUpMorph frame: (0 at 0.1 corner: 1 at 1).
window openInWorld./_//_
Enjoy
--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/20080821/020224a5/attachment.htm
More information about the Squeak-dev
mailing list
|