the World, its Hand, Morphs, and event handling

Lex Spoon lex at cc.gatech.edu
Wed Oct 25 04:09:32 UTC 2000



> > By the way, there is a way to implement "connect two things" from Ned's
> > example in the current system.  Basically, you need a ConnectionMorph
> > (which you probably need anyway), and you need an EndpointMorph.  When
> > you make a click that starts a connection, create an EndpointMorph and a
> > ConnectionMorph, connect the ConnectionMorph to the EndpointMorph and to
> > whatever was clicked on, and then attach the EndpointMorph to the hand.
> > When the Endpoint morph gets dropped, then the right thing happens
> > depending on where it is dropped.  Of course it's just one example, and
> > there are surely harder examples, but it's interesting how far current
> > Morphic can go.
> 
> I've already been down that path. I have a ConnectionMorph and EndpointMorph.
> 
> First problem is the "making a click that starts a connection". Let's say
> I want to connect a Rectangle to another Rectangle. I click on the Rectangle,
> and ... oops! the Hand says "I know what a click means" and picks up the first
> Rectangle. Well, that didn't work.
> 

The hand will only pick something up if every morph in the "core sample"
says that it isn't interested in the mouseDown event....  So, have one
of those morphs say that it wants the mouseDown event.  Presumably the
rectangle in question is embedded in some sort of EditorMorph, so the
EditorMorph could grab the event.

Maybe the current system is flexible enough after all?


Also, consider this case: the mouse enters an editor morph, chooses a
tool, leaves the editor morph, and then comes back again.  Ideally, the
same tool would remain active when the hand returns.  But where does
this tool get remembered?  Probably each morph that wants to do
something unusual, is going to want a dictionary mapping hands into
hand-specific data for when the hand is absent.  But if you've already
got such a morph-specific dictionary, there doesn't seem to be a need to
store anything directly in HandMorph.




-Lex





More information about the Squeak-dev mailing list