Programming in XPCE/Prolog: Section 5.2

## 5.2 Compound graphicals

Often one would like to combine two or more primitive graphical objects into a single unit. This is achieved using class device. Below we create an icon, consisting of a bitmap and a textual label displayed below it.

    9 ?- new(@ic, device),
         send(@ic, display, bitmap('happy.bm')),
         send(@ic, display, text('Happy'), point(0, 64)),
         send(@p, display, @ic, point(250, 20)).

A compound graphical may be treated as a unit. It may be moved, erased, coloured, etc. by sending a single message to the compound. Compound graphicals are normal graphicals and thus may de displayed on other compound graphicals, resulting in a consists-of hierarchy of nested graphicals. See also section 12.4. The classes related to compound graphical objects are shown in table 3.

device | Most generic compound graphical object. The window is a subclass of device and all graphical operations are defined on class device.
figure | Subclass of device, provides clipping, background, containing rectangle, border and the possibility to show a subset of the displayed graphical objects.
format | A format object specifies a two-dimensional table layout. Formats may be associated to graphical devices using `device`->`format'.
table | The successor of format realises tabular layout compatible to the HTML-3 model for tables. See section 11.5.

Table 3 : Compound graphical classes