A MUI application consists of a (sometimes very) big object tree. The root of this tree is always an instance of application class, called application object. This application object handles the various communication channels such as user input through windows, ARexx commands or commodities messages.
An application object itself would be enough to create non-GUI programs with just ARexx and commodities capabilities. If you want to have windows with lots of nice gadgets and other user interface stuff, you will have to add window objects to your application. Since the application object is able to to handle any number of children, the number of windows is not limited.
Window objects are instances of window class and handle all the actions related with opening, closing, moving, resizing and refreshing of intuition windows. However, a window for itself is not of much use without having any contents to display. That's why window objects always need a so called root object.
With this root object, we finally reach the gadget related classes of the MUI system. These gadget related classes are all subclasses of Area class, they describe a rectangle region with some class dependent contents. Many different classes such as strings, buttons, checkmarks or listviews are available, but the most important subclass of area class is probably the Group class. Instances of this class are able to handle any number of child objects and control the size and position of these children with various attributes. Of course these children can again be group objects with other sets of children. Since you usually want your window to contain more than just one object, the root object of a window must always be a group class object.
In MUI Royale GUIs are defined entirely using the XML markup language. Here is an example what an application tree could look like in an XML declaration:
<?xml version="1.0" encoding="iso-8859-1"?> <application base="HELLOWORLD"> <window title="Example GUI" muiid="MAIN"> <vgroup> <listview> <column/> </listview> <string/> <hgroup> <button>Add</button> <button>Remove</button> </hgroup> </vgroup> </window> </application>
Because these first paragraphs are very important for understanding how MUI works, here's a brief summary:
An application consists of exactly one application object. This application object may have any number of children, each of them being a window object. Every window object contains a root object that must be of type group class. This group object again handles any number of child objects, either other group objects or some user interface elements such as strings, sliders or buttons.