The event loop waits for an incoming event: if this event is a key press, the application exits; if it is an expose event, the window content is drawn.
Often, for ease of use, the select loop is implemented as an event loop, perhaps using callback functions; the situation lends itself particularly well to event-driven programming.