[newbie] PasteUpMorph update

Karl Ramberg karl.ramberg at chello.se
Tue Nov 26 13:08:23 UTC 2002


Stefan Champailler wrote:
> 
> Dear you all,
> 
> I have made a small program taht creates a PasteUpMorph and puts some
> RectangleMorph inside. It works perfectly. Now I want to animate the
> rectangle a bit. Therefore I've constructed some code to update the
> Rectangle's position. Unfortunately, I have to bring the focus on the
> PasteUpMorph  to see the rectangles move. So basically, what I need is a
> way to "refresh" the PasteUpMorph each time I change the rectangle's
> position. Or, I simply just miss a philosphical point here.
> 
Easiest way to this is to make use of the morphic stepping.
Like: 
RectangleMorph>>step
		    self position: (self position + (3 at 0))


This adds the rectangle and it movements to the world cycle and update 
should be automatic.



More information about the Squeak-dev mailing list