Next Previous Contents

## 4. XML User Interface

Tcl, together with the graphical toolkit extension Tk was chosen to provide a Graphical User Interface for Comanche. As seen in previous sections, the interface can be described in terms of a mark up language based on XML. The interface description can be parsed and abstracted into [incr tcl] objects (see Glossary on Tcl and [incr tcl]). This intermediate abstraction layer allows for different rendering engines. The rendering can transform the objects into DHTML (Dynamic HTML) that can be rendered by a web browser or into a traditional GUI representation. It is possible for the front ends to issue callbacks and manipulate the Tcl object. If XUI objects share the same interface (like string, number), the same GUI object class can manipulate them. Conversely, the same xui object can be rendered differently by different GUI object class: an element of the type structure can be rendered like a collection of property pages or as several groups of directives.

Examples of guiInterfaces are :

## 4.1 guiString

Can render xuiString and xuiNumber elements.

## 4.2 guiLabel

It is used to represent elements of the type label

## 4.3 guiLabeled

All the elements that have a label inherit from this guiObject class. It provides for text alignment of the labels so the interface looks nice.

## 4.4 guiBoolean

It is used to represent elements of the type guiBoolean

## 4.5 guiImage

It is used to represent images

## 4.6 guiChoice

It is used to manipulate xui elements of the type choice. It is generally represented as a combobox. It could easily be represented as a collection of radiobuttons.

## 4.7 guiList

It is used to manipulate list objects

## 4.8 guiStructure

Is is used to manipulate xuiStructure elements. xuiStructure elements can represent compound directives or groups of other xuiElements. Depending on certain attributes being present (style) groups of directives can be represented in different ways: horizontally or vertically, surrounded by a labeled frame or with no decoration.

## 4.9 guiAlternate

Is is used to manipulate xuiAlternate elements.

## 4.10 guiPropertyPage

This gui element manipulates xuiStructures interpreting them as property pages:

## 4.11 How it works

This section describes how the process works from the instant that the user requests some information to the point that the user is presented with a property page that he can fill and return the information to the plugin.

- User selects to view the properties of a given node, by right clicking on the node and selecting the "Configure node" entry from the menu.
- The message is sent to the namespace, which contacts the appropriate plugins and generates the property pages document, which it is a XML description of the property pages.
- The console receives the document, transforming it into a xuiObject of the type xuiPropertyPages (the XML definition is transformed into Tcl code).
- The console needs to allow the end user to manipulate the xuiPropertyPages object and for that purpose creates a guiPropertyPages (presentation) object and connects it to the xuiPropertyPages object (data).
- The guiPropertyPages object is passed the frame where it has to display its information, the propertyPages object and a reference to an object factory. It creates a listbox menu on the left and a notebook on the right. For each one of the property pages (elements of the xuiStructure), it creates an entry in the listbox (with an additional image if the attribute icon is present) and uses the guiObject factory to render the property page on the notebook.
- When an element is selected on the listbox, the appropriate property page is displayed on the right notebook.
- When the user is done, it can press the Ok button. The GUI representation can be destroyed then, but the xuiPropertyPages object will have the modifications performed by the user.
- The xuiObject is then passed to the namespace, which will select the appropriate property pages and deliver it to the plug ins so they can act upon it.

Next Previous Contents