[squeak-dev] Event handling challenges

Trygve Reenskaug trygver at ifi.uio.no
Mon Jun 15 13:25:45 UTC 2020


/The figures were missing when this message reached me. I resend itwith 
the figures attached.
-------------------------------------
/
Hi Squeakers,
My SRE context browser is a tool for drawing a snapshot of a selected 
structure of interlinked objects where each object is shown as a 
rectangular symbol. This diagram shows an object with its class and 
superclass objects:


SRE has worked for years, last in 'Squeak3.10.2'. In 'Squeak5.3', the 
same program went into an infinite loop. It transpired that 
/myClass>>processEvent: anEvent using: defaultDispatcher/ had become a 
new thing called an event filter and needed to return an Event or a 
Symbol. That problem fixed; the program still misbehaves. The problem 
seems to be with event handling. I have never been into that corner of 
Smalltalk but have read some Squeak documentation. I have not found any 
concrete code.  I realize that I will never understand Squeak's event 
handling by reading code, code comments, and even the documentation I 
have found. There has apparently been a significant increase in 
complexity lately. An example: In 3,10,2, class /MorphicEventDispatcher 
/has 4 methods. In 5,3, it has 16.

Here's the beginning of my challenges with 5.3: I find two anomalies in 
a diagram with just one symbol:

 1.      When I move some other window to a position within the diagram,
    the diagram grabs it and makes it a submorph of itself.  In 3.10.2,
    the diagram ignores it.
 2.      The cursor becomes a text cursor when I move the mouse across a
    symbol.

I have no explanation for either anomaly. My SRE code is a kludge and is 
almost unreadable. It is hard to formulate a question without the whole 
code as a background, and I have tried to reproduce them in a simple 
example. I managed to reproduce the first, but not the second anomaly. 
In a workspace, copy, select,  and do it. The XXX-symbol becomes 
attached to the cursor, and I place it in the blue background.

    joe := PasteUpMorph new color: Color lightBlue.
    joe bounds: (500 at 400 corner: 800 at 600).
    joe dropEnabled: true.
    joe openInWorld.
    circle := CircleMorph new.
    joe addMorphCentered: circle.
    tex := TextMorphXX new
             contents: 'XXX';
             borderWidth: 1;
             color: Color red;
             extent: 100 at 100.
    tex openInHand.

There is only one  method in class TextMorphXX (sco TextMorph):

    processEvent: anEvent using: defaultDispatcher
         ^#rejected



I move some background window,  actually a collapsed Monticello thing, 
to Joe's position, Joe grabs it and makes it into a submorph. Any hints 
about how to proceed will be greatly appreciated.
--Trygve






-- 

/The essence of object orientation is that objects collaborateto achieve 
a goal. /
Trygve Reenskaug mailto: trygver at ifi.uio.no <mailto:%20trygver at ifi.uio.no>
Morgedalsvn. 5A http://folk.uio.no/trygver/
N-0378 Oslo http://fullOO.info
Norway                     Tel: (+47) 468 58 625

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200615/9562c3eb/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clfapgjkmegmpnfm.gif
Type: image/gif
Size: 14037 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200615/9562c3eb/attachment-0002.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ojfapckoaibeechh.png
Type: image/png
Size: 42394 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200615/9562c3eb/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1: SRE Context Browser [3072DemoEllipseSRE Step mechanism.1.gif
Type: image/gif
Size: 8630 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200615/9562c3eb/attachment-0003.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2: SRE anomaly example.png
Type: image/png
Size: 42394 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200615/9562c3eb/attachment-0003.png>


More information about the Squeak-dev mailing list