Mantis - Squeak
Viewing Issue Advanced Details
5251 Morphic crash always 10-18-06 10:32 09-08-08 15:34
closed 3.9  
none 3.10  
0005251: [Bug] Setting a morph to adhere to a non-understood edge causes a tight endless loop if the morph is displayed.

m:= RectangleMorph new openInWorld.
m setToAdhereToEdge: #center .

m setToAdhereToEdge: #topCenter .

Will kill the usefulness of the image by putting it into a tight endless loop.
Found this while experimenting with the answers to how to adhere a morph to a corner thread on squeakdev (Oct2006).

The interactive menu presents only the save alterative.

But there are no checks before the property is set or used.
The results are dire.

So it needs to be fixed.

Also it should work for #topCenter and the other centers since users would expect this.

And other generalizaitions suggest themselves.

 MorphBugs.wiz.1.cs [^] (535 bytes) 10-19-06 09:05 [^] (508 bytes) 10-19-06 09:06

10-19-06 09:10   

MorphBugs.wiz.1.cs - the test - the fix

the fix consist of setting guards just before the task is performed.
if it is not performable it is now does nothing.

This prevents the endless error notifications.

Yours in service, -- Jerome Peace
10-19-06 09:16   
It still doesn't make adhere to # topCenter a viable option.

[OT] I've also noticed that the DockingBar of dgd implements this by making lots of methods for each case. A good candidate for refactoring. Especially since it chose to use its own vocabulary. (Which sad to say are more natural than the names of the methods traditionally used.)

So I note this as a candidate for generalization and simplification. But that as they say is an story for another report.

Cheers -Jer
04-17-07 12:15   
This now is part of 7080wizFixesOfMorph.cs and was in updates for 3.10
Thanks Jerome !
09-08-08 15:34   
In update 7080 released with 3.10.