Drawing oddity - anyone know why?

Bob Arning arning at charm.net
Mon Jul 13 04:50:38 UTC 1998

I have run across an oddity that I can't figure out, so if you feel like a
little sleuthing,

1. File in the code below (written in 2.1)
2. Choose BobsOddMorph from the World/New Morph/Basic menu.

What I can't understand is why the morph draws in green while being moved,
but draws in red when placed on the desktop. If you know, I'd love to hear


--- code to file in begins here ---
'From Squeak 2.1 of June 30, 1998 on 12 July 1998 at 3:58:59 pm'!

!FormCanvas methodsFor: 'drawing' stamp: 'RAA 7/12/1998 15:57'!
bobsExperimental: destRectangle
	| buff tempCanvas |
	self fillRectangle: destRectangle color: Color green.

	buff _ Form extent: destRectangle extent depth: Display depth.
	tempCanvas _ FormCanvas on: buff.
	tempCanvas fillColor: Color red.

	port copyFrom: buff boundingBox in: buff to: destRectangle origin.

	self text: 'red or green?' bounds: destRectangle font: nil color: Color
black.! !

'From Squeak 2.1 of June 30, 1998 on 12 July 1998 at 3:59:06 pm'!
StringMorph subclass: #BobsOddMorph
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Morphic-Basic'!

!BobsOddMorph methodsFor: 'as yet unclassified' stamp: 'RAA 7/12/1998
drawOn: aCanvas
	aCanvas bobsExperimental: bounds! !

More information about the Squeak-dev mailing list