Classes for event-driven programming