Pink Plane vs Blue Plane
Daniel Joyce
daniel.a.joyce at worldnet.att.net
Fri Feb 14 04:39:57 UTC 2003
> Or, in short:
> * the hand generates a MouseDownEvent from Sensor's input
> * it sends the event using #handleListenEvent: to the registered
> listeners * it sends the event using #handleFocusEvent: to the
> current focus (if present)
Focus is special, I understand that. I assume the eventhandling here
refers listners who are intrested in mouse clicks, but who have not
been clicked in? Else it seems redundant with what is below.
> [#handleFocusEvent: typically simply invokes #handleEvent:, see
> below] * if no focus, it sends the event using #dispatchEvent: to its
> owner (a world)
> * the event is dispatched along the front-most, visible, unlocked
> chain of submorphs containing it, until it reaches a leaf
This is standard....
> [on its way down, any morph can install a prospective handler if
> interested]
Why doesn't a morph install a handler when created, why does it install
one now? ( Is there a reason for lazy handler initialization? )
> * when the event traverses back up the chain, the event is sent to
> each morph in this chain using #handleEvent:
This seems bizzare. So an event goes all the way to the bottom before
coming all the way back up and possibily being handled? What is the
reason for this?
Or wait, is this to make handling changes (caused by handling of the
event ) in submorphs of a parent morph easier for the parent morph?
Here's another question then....
Parent has ChildA, ChildB, ChildC, all of who are leaves...
It forwards EventFoo to each.
EventFoo bounces back from the Children after being handled by them...
So does that mean the parent sees EventFoo bouncing back up 3 times?
Now, given this is a mouseclick, possibly inside a morph, seems
wasteful, since the mouseclick could ostensibly occur only inside one
of the submorphs ( or none of them) ( except for those morphs who say
"I'm intrested in all mouse clicks, not just those inside me" )
Does Morphic do this culling, or by default, do parents recieve 'echos'
of events from the children they forward them to?
> * #handleEvent: double dispatches the event into any of the
> system-level handlers
> * the system level handler (#handleMouseDown: etc) decides whether to
> invoke the user-level handler(s)
> * finally, the user-level handler (#mouseDown:) is invoked.
>
> Cheers,
> - Andreas
The double dispatch is definitely needed, and I understand that
fully.... ( In fact, it's part of my design idea I'm working on ).
Hmm, am I right on this, or could it be simpler?
More information about the Squeak-dev
mailing list
|