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

Ken Causey ken at ineffable.com
Thu May 9 22:26:09 UTC 2002


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:

SystemWindow newWithoutLabel
	addMorph:
		(StringMorph contents: 'Comments:')
	frame: (0.1 at 0.03 corner: 0.9 at 0.1);
	addMorph:
		(PluggableTextMorph
			on: self
			text: #comments
			accept: nil)
	frame: (0.1 at 0.1 corner: 0.9 at 0.6);
	addMorph:
		(self buildCheckBox: 'Report to Razor?'
			getSelector: #reportToRazor
			actionSelector: #toggleReportToRazor)
	frane: (0.1 at 0.6 corner: 0.9 at 0.7);
	addMorph:
		(self buildCheckBox: 'Report to SpamAssassin Sightings?'
			getSelector: #reportToSASightings
			actionSelector: #toggleReportToSASightings)
	frame: (0.1 at 0.7 corner: 0.9 at 0.8);
	openInHand

Where

buildCheckBox: text getSelector: getSelector actionSelector:
actionSelector
	"Return a check box with a string description"
	^ (AlignmentMorph newRow)
		addMorphBack:
			((UpdatingThreePhaseButtonMorph checkBox)
				target: self;
				getSelector: getSelector;
				actionSelector: actionSelector);
		addMorphBack:
			(StringMorph contents: text);
		borderWidth: 0

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

Ken




More information about the Squeak-dev mailing list