[BUG] [Morphic] SystemWindow>>addMorph:fullFrame: overrides morph settings?

Ned Konz ned at bike-nomad.com
Thu May 9 22:51:01 UTC 2002


On Thursday 09 May 2002 03:26 pm, Ken Causey wrote:
> This has been bugging me for a while now.  The proper way to do
> layout with a SystemWindow as I understand it is to use
> SystemWindow>>addMorph:frame: which in turn calls
> SystemWindow>>addMorph:fullFrame:.  But
> SystemWindow>>addMorph:fullFrame: willynilly overrides borderWidth
> and color of the added morph.  Is there some logical reason for
> this?  It's rather annoying to me that I have to go back and set
> such things on my morphs AFTER adding them to the parent morph.  I
> want to be able to code like:
>

Why not just define SystemWindow>>addMorphSimply:fullFrame: or 
something (not sure about the name):

addMorphSimply: aMorph fullFrame: aLayoutFrame
	super addMorph: aMorph fullFrame: aLayoutFrame.
	paneMorphs _ paneMorphs copyReplaceFrom: 1 to: 0 with: (Array with: 
aMorph).
	Preferences scrollBarsOnRight	"reorder panes so flop-out right-side 
scrollbar is visible"
		ifTrue: [self addMorphBack: aMorph]

> This seems like clear straightforward logic to me, avoiding useless
> temporaries.  Why is SystemWindow designed to defeat this and force
> me to use temporaries?

I don't know. Why does SystemWindow have an unused instvar called 
"paneRects"? Probably for the same reason: to annoy us.

-- 
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE




More information about the Squeak-dev mailing list