Event-Driven Programming Programming a GUI is usually done using an event-driven model. The program mostly sits idle and waits for events. When an event arrives, a big "switch" code invokes a function that deals with the specific type of event. These functions are called "callbacks" - cause they are called back from the GUI's engine, unlike regular programming, in which the main function calls up functions to perform sub-tasks.