Start Application

Start Event Loop

Draw GUI to Screen

Draw GUI to Screen

Register Handlers

Register Handlers

Register Handlers

Event Queue

User Clicks Button

OS Receives Event

OS Adds Event to Queue

Event Loop Polls Queue

Event Loop Finds Handler

Event Loop Calls Handler

Handler Updates GUI

Event Loop Continues

Event Loop Paints GUI

Event Loop Paints GUI