src/swipl-devel/packages/xpce/man/refmanual/md/tree.md

class tree {#class-tree}

Class tree is a subclass of class device which displays its graphical objects formatted as a hierarchy. Class tree fits well in PCE's target domain: graphical interfaces for structured representations (models).

The nodes of a PCE tree may be arbitrary graphical objects (yes, even trees, editors, etc.). Trees allow for multiple inheritance, but the automatically generated layout is often not optimal when multiple inheritance is used intensively. The automatically generated layouts for hierarchies are top-to-bottom, left-to-right (default) or `indented list'.

Class tree itself is responsible for displaying and formatting the nodes of the hierarchy. The hierarchy is defined by node objects. A node object refers to a graphical (using node <->image), its parent node(s) and its son nodes.

Event-handling for trees may be done in two ways. The first is to define event-handling for each of the individual graphicals representing the nodes. The second is to associate recognisers with the tree object itself. Class tree defines various different recognisers, activation of which depends on the status of the node. See tree ->event.

@see graphical->layout @see class node

Instance variables {#class-tree-instvars}

Send methods {#class-tree-send}

Get methods {#class-tree-get}



Try the rswipl package in your browser

Any scripts or data that you put into this service are public.

rswipl documentation built on June 16, 2026, 5:07 p.m.