Mantis - Croquet
Viewing Issue Advanced Details
831 Jasmine tweak always 01-14-05 11:41 01-15-05 19:31
0000831: We can not run two teapot in an image.
This change set is first attemt to run Teapot in one Squeak image.
It is not enough to use, but sometimes works well.
The reason why I need is to debug a behavior on network easily.
I don't want to start up two images often!
 TwoTeapotInOneImage.cs.gz [^] (3,057 bytes) 01-14-05 11:41

01-15-05 06:01   
The changes look rather unmotivated and partly questionable to me. I don't see what any of this would have to do with running multiple Teapots side-by-side. Changing TeaMessage>>error: to silently do nothing looks outright dangerous; setting theTeapotMorph to self in TeapotMorph>>delete and drawOn: looks very odd.

This all has the feel of something being debugged into existence without fully understanding what the problems involved are (if it works I'd say it's pretty much by chance). I recommend against including any of it until this has been resolved and we have an understanding (e.g., comments in the appropriate places) why any of the above would be needed (and by "why" I mean something other than "it doesn't work without it" ;-)
01-15-05 07:12   
As you said, this change set includes questionable codes. Especially, TeaMessage>>error: is dirty. I had to post the code because I was glad that the code worked well by accident;)

The reason of why two Teapots don't work in a image is a class variable of TheTeapotMorph. This variable supposes Teapot is a single object at a time. At first, I though how I can remove TheTeapotMorph, and CroquetGlobals >> theTeapotMorph points correct Teapot object connected with the sender. But it was difficult as a lot of object couldn't point Teapot without the global variable.

So I tried to store current teapot into TheTeapotMorph each step at TeapotMorph >> drawOn: as a dirty hack. I referred to ActiveHand at WorldState >> doOneCycleNowFor:. I know this approach was not good, but anyway sometimes it worked well, and I was able to see two teapots and four avatars on an image [^]

Anyway, I need such multiple instances on an image because writing test codes. I don't think clicking and dragging with mouse at two images is good way to debug. So I am going to refine the code.

01-15-05 07:30   
I see. Let's delay this a little until I have finished my work on islands (hopefully by next week). Then, having multiple teapots should be trivial (cross your fingers...)
01-15-05 19:31   
Using CroquetGlobals is the "right" way to fix this - a Class Variable should never have been used for this purpose. Shouldn't be that much work. I have no clue what "islands" are in Jasmine or why they would be relevant.