[squeak-dev] Re: Event filters for user input events (i.e. mouse clicks etc.)

Tony Garnock-Jones tonyg at ccs.neu.edu
Wed May 18 20:02:27 UTC 2016


On 05/18/2016 12:12 PM, tim Rowledge wrote:
> Seems to me that a significant part of the potential
> usefulness would be to have filters transform events [...]

One interesting approach would be to take a leaf from functional
programming.

Instead of returning a boolean from a filter, you'd have it expect a
continuation block.

  filter := PluggableEventFilter new on: [:e :target :k |
     Transcript showln: e printString.
     k value: e ].

It would invoke the block with some event, or not, according to the
filtering decision.

This gives it an opportunity to pass on either its argument; or a copy
of its argument; or its argument, modified; or something unrelated.

Tony


More information about the Squeak-dev mailing list