[squeak-dev] Re: mouse enter/move/leave event confusion

tim Rowledge tim at rowledge.org
Sat Dec 5 04:37:10 UTC 2015


> On 04-12-2015, at 2:33 AM, Stephan Eggermont <stephan at stack.nl> wrote:
> 
> Hmm. conceptually I would expect to get no spurious enter/leaves when the morph you're dragging around is either a submorph of the canvas, or grabbed by the hand.

Well, I’ve now done this I think four ways, so roughly speaking -
a) making a morph  as a fake-cursor, opening it in the World and dragging it around via the canvas’ mouseEnter/Move/Leave messages doesn’t work well. I got many leave/enter messages and so the fake-cursor would get deleted and recreated very often. Also, since my mouse enter code made the morph and opened it it would appear in the top-left before flickering to the ‘proper’ place and then back and forth with each leave/enter.
b) the next try added the fake-cursor as a submorph of the canvas, which caused some interesting layout issues until I noticed that it really ought to get position before adding it. It worked relatively well except for ruining performance.
c) another attempt at a) along with centring the morph on the cursor position showed me the error of my ways and explained the spurious leave/enter flickering.
d) the latest code adds gridding to the HandMorph if and only if there is a temporaryCursor set.

Using the ‘attach’ protocol simply didn’t occur to me. Which is crazy since I’ve used it enough to drag blocks and sprites around. Perhaps I’ll try it out.

tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
A sad tale that brings a lump to the eye and a tear to the throat.




More information about the Squeak-dev mailing list