1. A computer-implemented method comprising: creating, using a processor, a graphical user interface (GUI) using a layout editor, the layout editor providing a plurality of graphical elements for selection; generating, using the processor, a graphical state diagram representation for selected graphical elements from the plurality of graphical elements where: the graphical state diagram representation includes: a plurality of states, wherein: the plurality of states correspond to the selected graphical elements, at least two of the plurality of states are active in a parallel mode to each other, and at least another two of the plurality of states are active in an exclusive mode to each other, a plurality of transitions, and one or more executable instructions associated with the plurality of states or the plurality of transitions, the one or more executable instructions modeling an underlying control structure of the selected graphical elements, the underlying control structure implementing a functionality of the GUI, and the graphical state diagram representation is generated based on the selected graphical elements; and generating, using the processor, computer program instructions from the graphical state diagram representation where: the computer program instructions implement the selected graphical elements and the underlying control structure of the selected graphical elements, and the selected graphical elements are implemented as part of the GUI.