Adding more snippets to the event-handling documentation