1. A method for creating a graphical user interface (GUI), comprising: arranging one or more interface elements in a graphical layout editor to define a visual appearance of the GUI; defining one or more events associated with the interface elements; building, from the one or more interface elements and the one or more events, a state diagram model of the GUI, the state diagram model including a plurality of states and one or more transitions linking at least some of the states; displaying the state diagram model to a user; simulating the state diagram model to test functionality of the GUI; in response to the simulating, modifying the one or more interface elements or the one or more events associated with the interface elements; and generating the GUI.