[squeak-dev] Re: EventSensor questions

Igor Stasenko siguctua at gmail.com
Thu Feb 12 19:10:30 UTC 2009


2009/2/12 Andreas Raab <andreas.raab at gmx.de>:
> Michael Rueger wrote:
>>
>> Andreas Raab wrote:
>>>
>>> I'm not sure if having multiple listeners is useful at this level - all
>>> EventSensor does is pulling the events from the VM, packaging them up and
>>> passing them into the event queue for any downstream consumers. If there
>>> were multiple listeners in a morphic environment, they should probably be
>>> registering with the hand (which has such a listener mechanism already), not
>>> with Sensor. What's the use case for this refactoring?
>>
>> The refactoring allows for listeners *outside* the morphic environment to
>> listen to input and window events, supporting alternative UI frameworks like
>> e.g. Miro.
>
> Miro must be an unusual framework then (where is it?). Generally speaking,
> Squeak UI frameworks all have the need for some sort of top-level desktop
> (representing Display) which is the natural (and generally only) receiver
> for events from Sensor. That is true for MVC, Morphic, Tweak etc. The only
> situation in which I could imagine not having a desktop representative is
> when it comes to native windows (in which case there is a native desktop
> that Squeak doesn't control) and here one obviously wants to dispatch events
> to all the different windows. Although even here I would probably opt for a
> dispatch table in Sensor mapping window IDs to event queues instead of a
> straightforward listener.
>

When you have a multiple host windows using hostwindowplugin, we need
to dispatch events to a host window first, and then handle them with
any framework, which is bound to that window.
For this means, the role of Sensor will primarily to poll events from
VM , and convert them to events from raw byte array.
Next, it should dispatch an event based on window id, and then window
should push it farther to whatever listener it have to.
The event handling logic could be different, from what i described,
but anyway, i would love to see, that there is no other classes in
system, which need to deal with raw event buffer except EventSensor.
This should help a lot in code clarity & reducing complexity.


> Cheers,
>  - Andreas
>
>



-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list