Yellow Button and Morphic

Dan Ingalls DanI at wdi.disney.com
Sat May 30 00:07:42 UTC 1998


Bill Dargel wrote...
>The second problem manifests itself as this: When selecting an item from
>the menu by releasing the yellow button, sometimes it is acted upon and
>sometimes it is ignored. This seems to be quasi-random. Certain list
>menus seem to work all the time, some seem never to work and the Browser
>text pane seems to work/not work at random.
>
>What I've managed to track down is this:
>
>    MenuItemMorph>>mouseUp: evt
>is ignoring the event because
>    mouseInMe := self bounds containsPoint: evt cursorPoint.
>is evaluating to false. When this is working (like from the scroll-bar
>menu button), both 'bounds' and 'cursorPoint' are in display
>coordinates. The event "evt" is passed in from
>    HandMorph>>handleMouseUp:
>which does
>    oldFocus mouseUp: (self transformEvent: evt)
>The problem comes from the 'eventTransform' of the HandMorph. In the
>case I investigated, the transform has negative offset equal to the
>display coordinates of the PluggableListMorph's origin.
>
>Why this is so, or how to fix it, has me baffled. Any Morpher out there
>with an easy answer?

Yes.  Here's the explanation...
The problem is that the yellowButton path to pane menus runs through some compatibility code that loses the proper event trail.  In the process, the Hand, which was caching the coordinate transform (roughly = scrolling offset) for the text or list in focus, suddenly gets told to direct its events at a menu that is at the top level, and thus in screen coordinates.

....and here's the fix...
in HandMorph>>newMouseFocus:, add the following statement at the end:

	self updateMouseDownTransform

Thanks for your other sleuthing.  We'll get a new update for this out anon.

	- Dan





More information about the Squeak-dev mailing list