Graphical User Interfaces (GUIs)

The GUI of a program often consists of one main window (the desktop) con taining several sub-windows (views, toolbars, menu bars, control panels, etc.) These sub-windows may contain sub-sub-windows, etc. A window may also contain controls such as buttons, sliders, menu items, and text boxes. We can model most GUIs using the Composite Design Pattern: