While you are not likely to write a program as complex as a word processor, all GUI programs share the same programming paradigm.
First of all, GUI elements are designed and put in place. GUI elements include the more basic ones like buttons, textboxes, checkboxes and radiobuttons, to more complex ones like listboxes and comboboxes. In most applications, such GUI elements are contained in container elements like a form. However, it is also possible to put GUI elements in a more primitive container called a “Window”.
Most GUI elements come with some “native” capabilities. For example, a checkbox can respond to a mouse click and toggle its state. Furthermore, a textbox can respond to keypresses and edit contained content.
However, a collection of GUI elements that operate independently is not very useful. In order for a GUI program to perform a useful function, the GUI elements need to cooperate and interact with data that is being edited, presented or processed.
This means that as a checkbox is toggled, the event should also update the data that the checkbox represents. Similarly, when a button is clicked, an action should be performed accordingly. Such actions cannot rely on the “native” abilities of GUI elements.
Instead, logic that is specific to each application must be expressed to handle events, often in addition to the native abilities of a GUI control. For example, when a checkbox is clicked, a special “event handler” containing application specific logic executes. This handler executes when the checkbox state changes, permitting custom code to alter the data being represented by the checkbox.