[squeak-dev] Morph doesn't paint on every tick?

Louis LaBrunda Lou at Keystone-Software.com
Wed Dec 27 00:22:52 UTC 2017

Hi All,

I'm making a CalendarDisplayMorph.  The code below is called every second.  I'm sure it is
being called every second.  But the seconds don't change every second.  It does change if I
click on the morph and select or move it or something.

I'm testing it with this:

	(TransformationMorph new asFlexOf: CalendarDisplayMorph new) openInWorld.

What am I missing?


	"Display the date and time in the header."
	| font rect canvas fWidth weekDay dateString timeString |

	font := TextStyle default fontOfSize: 96.
	fWidth := self extent x.

	canvas := destForm getCanvas.
	rect := Rectangle origin: 0 at 0 extent: fWidth at headerHeight.
	canvas frameAndFillRectangle: rect fillColor: self cellColor borderWidth: 2 borderColor: self
	currentDate := DateAndTime now.

	weekDay := currentDate dayOfWeekName asString.
	self drawString: weekDay centeredIn: rect vOffset: 5 withFont: font color: self textColor.

	dateString := currentDate monthName, ' ', currentDate dayOfMonth printString, ', ',
currentDate year printString.
	self drawString: dateString centeredIn: rect vOffset: 35 withFont: font color: self

	timeString := String streamContents: [:aStream | currentDate asTime print24: false
showSeconds: true on: aStream].
	self drawString: timeString centeredIn: rect vOffset: 65 withFont: font color: self
Louis LaBrunda
Keystone Software Corp.
SkypeMe callto://PhotonDemon

More information about the Squeak-dev mailing list