Most widget toolkits use event-driven programming as a model for interaction. The toolkit handles user events, for example when the user clicks on a button. When an event is detected, it is passed on to the application where it is dealt with. The design of those toolkits has been criticized for promoting an oversimplified model of event-action, leading programmers to create error-prone, difficult to extend and excessively complex application code. Finite state machines and hierarchical state machines have been proposed as high-level models to represent the interactive state changes for reactive programs.