Mantis - Squeak
Viewing Issue Advanced Details
3309 Morphic major always 03-15-06 06:21 07-23-06 12:37
closed 3.9  
none 3.9  
0003309: In 7008 Requesting setTarget for menus can get a UndefinedObject DNU>isHandMorph
One of the changes to 7008 were the extention of target sighting to menus .

For this one get a Morph
Get the halos for it.
Get the red menu for it.
Make it stay up.
Get the halos around the menu .
Get the meta menu (red handle).
Select the item set target. -- A cross hair will appear.
Move it over a morph (can be the same one).
MouseDown. ( a popup menu of morphs underneath the cursor comes up)
Select a new (or the same target.)

the UndefinedObject DNU>isHandMorph pre-debug warning will result.
The first culprit is the item embed into: which has an undefined target ivar.

There were two choices for solution.

Move the backstop for isHandMorph from morph upto Object.
While I like this solution, there are 15 methods that call isHandMorph .
So that would have somewhat large consequences and maybe prevent someone maintaining those methods from catching a bug early.

The other solution was to modifiy the MenuMorph method that chooses what is the appropriate new target. Which works also but more locally.

This method now looks for a nil target first. If the target is nil it is left that way rather than changed.

That fixes things enough to prevent the debug window coming up.

Retargeting the menuItem "embed into" still does not produce the desired results. Apparently the actual target is accessed in some other way and it would need a special method to handle #target: newTarget correctly..

In general the retargeting works for some menu items and not for others.
Simple actions generally work. Actions with updating items and submenus tend not to. That is an issue for another report. This one just focuses on the immediate DNU problem.

What's now been implemented to retarget menus, though by necessity incomplete, is a boon. Some things useful are doable that before where not. And it exposes some problems that were hidden when target setting was in a broken state.

Readers of this report are encouraged to play with it; report the bugs; and submit the enhancements that will help it be useful to a wider range of menu items.

Yours in service, -- Jerome Peace [^] (392 bytes) 03-15-06 06:21

07-23-06 12:37