A tree view is a pane that displays a hierarchical list of items. Each item may optionally have an image.
A list of the root nodes.
Returns the children of a node.
Returns an image for a node.
Returns a state image for a node.
Optional function which determines whether a node is a leaf node (that is, has no children). This is useful if it can be computed faster than the children-function
.
Specifies if the tree view remembers whether hidden nodes were expanded.
Optional function which is called to decide whether a node should be displayed in expanded form. If not specified, all nodes are displayed collapsed, so only the root nodes are visible.
Flag to specify whether items have images. Defaults to t
.
Flag to specify whether items have state images. Defaults to nil
.
Defaults to 16.
Defaults to 16.
tree-view-roots
tree-view-children-function
tree-view-image-function
tree-view-state-image-function
tree-view-leaf-node-p-function
tree-view-expandp-function
The tree view pane allows the user to select between items displayed in a hierarchical list. Although it is a choice, only single selection interaction is supported.
Initially, only the items specified by the roots
argument are displayed (unless an expandp
function is used, in which case further items may also be displayed).
Any item which has children has a small expansion button next to it to indicate that it can be expanded. When the user clicks on button, the children nodes (as determined by the children function) are displayed.
The image-function
is called on an item to return an image associated with the item. It can return one of the following:
This specifies the filename of a file suitable for loading with gp:load-image
. Currently this must be a bitmap file.
The symbol must have been previously registered by means of a call to gp:register-image-translation.
An image object, as returned by gp:load-image
.
This allowing a single bitmap to be created which contains several button images side by side. See make-image-locator for more information. On Windows, it also allows access to bitmaps stored as resources in a DLL.
This is a zero-based index into the tree-view's image list. This is generally only useful if the image list is created explicitly. See image-list
for more details.
The state-image-function
is called on an item to determine the state image: an additional optional image used to indicate the state of an item. It can return one of the above, or nil
to indicate that there is no state image.
If :image-lists
are specified, they should be a plist containing the following keywords as keys. The corresponding values should be image-list
objects.
Specifies an image-list object that contains the item images. The image-function
should return a numeric index into this image-list.
Specifies an image-list object that contains the state images. The state-image-function
should return a numeric index into this image-list.