Leandro's Traffic Light Morph

John Hinsley jhinsley at telinco.co.uk
Fri Dec 21 01:22:30 UTC 2001


I'm (slowly) translating LC's tutorial into English, re-doing the gifs
and methods to match 3.2 as I go along. Slowly because Morphic has
changed quite a lot in the meantime and my Spanish is dreadful (usually
I make as much sense as I can out of the Spanish by pretending it's
Italian and then grab the dictionary!): but I recon that if I don't do
it, it'll never get done.

At some point I decided to get it running and got ahead of the
translation.

Anyway, I rewrote the initialization method, thus:

| green orange red |
	super initialize.
	self listDirection: #topToBottom.
	self wrapCentering: #center; cellPositioning: #topCenter.
	self extent: 66 at 152.
	self color: (Color r: 0.0 g: 0.355 b: 0.258).
	self borderWidth: 	8.
	self borderColor: 	(Color r: 0.0 g: 0.581 b: 0.613).
	green _ LampMorph new. green color: (Color green).
	orange _ LampMorph new. orange color: (Color orange).
	red _ LampMorph new. red color: (Color red).
	self
		addMorph: green;
		addMorph: orange;
		addMorph: red

I guess I could improve on the indenting, but this works just fine. Is
it acceptable? Can I improve on it?

BTW, some of the methods in the Morphic version seem to be missing
altogether. Is this intentional (as in Squeakland's "hard learning" or
whatever?)?

Cheers

John
-- 
Reputed to be the reason Windows 2000 was nearly a year late, (paid in
shares M$Ds needed the cash and kudos) Netproject's Eddie Bleasdale has
renewed his challenge to virus writers. The first person to infect his
Linux box wins 10,000 pounds.

http://www.silicon.com/bin/bladerunner?30REQEVENT=&REQAUTH=21046&14001REQSUB=REQINT1=48211




More information about the Squeak-dev mailing list