First page Back Continue Last page Overview Graphics
Event-Driven Programming (1)
Consider a typical school day ...
Actions that occur are events.
- Bell rings.
- Teacher throws an eraser.
Objects that want to respond to events associate themselves with event handlers.
- When the bell rings, students respond by performing their 'runAndScream' behavior.
- When the teacher throws an eraser, students respond by performing their 'duckAndSmirk' behavior (if the event handler is 'smart', only the 'target' student ducks! :)
Notes: