[Pharo-project] The event handling mechanism implemented in Gaucho

Fernando Olivero fernando.olivero at usi.ch
Tue Mar 6 06:33:10 EST 2012

Hi, Stef and Esteban, i'm sending an overview of the event handling
mechanism of Gaucho. So we can discuss the additions of multitouch
events and the design as well.

Key classes: GUserInterface, GPeripheralDevice, GDisplay, GView and
the new event model.

GUserInterface: Collaborates with a sensor, and double dispatches the
event to the proper peripheral device.

GMouse,GKeyboard: a peripheral device that distinguishes the system
event, and sends the user interface  specific reactions: such as

#mouse: aGMouse entered: aGShape
#keystroke: aGKeystroke from: aGKeyboard

No reification of the events, just message passing amongst the user
interface, the peripherals, the display, the views, and the shapes.

EVENTS: from the user to the shape
1)the user clicks on the mouse
2) a system event is announced
3) the user interface dispatches it to the attached mouse
4) the mouse detects that its a click to a particular shape on a view
of the display and informs the user interface
5) the user interface informs the display of the click

VIEW: shape reacting to events and redrawing
6) the display informs the active view
7) the active view informs the shape
8) the shape reacts to the click.
9)the display asks the shape wether it should redraw, and informs the
damage recorder. Gaucho implements a visual garbage collector scheme,
so the code is not polluted with #changed ,similar to eliminating the
need to send #alloc and #dealloc on memory garbage collector. But this
is surely for another thread.

More information about the Pharo-dev mailing list