Next Prev Up Top Contents Index

tree-view

Class
Summary

A tree view is a pane that displays a hierarchical list of items. Each item may optionally have an image.

Superclasses

choice
titled-object
simple-pane

Slots

roots

A list of the root nodes.

children-function

Returns the children of a node.

image-function

Returns an image for a node.

state-image-function

Returns a state image for a node.

leaf-node-p-function

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 .

retain-expanded-nodes

Specifies if the tree view remembers whether hidden nodes were expanded.

expandp-function

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.

use-images

Flag to specify whether items have images. Defaults to t .

use-state-images

Flag to specify whether items have state images. Defaults to nil .

image-width

Defaults to 16.

image-height

Defaults to 16.

state-image-width

Defaults to image-width.

state-image-height

Defaults to image-height.

Accessors

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

Description

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:

A pathname or string

This specifies the filename of a file suitable for loading with gp:load-image . Currently this must be a bitmap file.

A symbol

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 .

An image locator object

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.

An integer

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.

:normal

Specifies an image-list object that contains the item images. The image-function should return a numeric index into this image-list.

:state

Specifies an image-list object that contains the state images. The state-image-function should return a numeric index into this image-list.

See also

choice


LispWorks CAPI Reference Manual - 14 Dec 2001

Next Prev Up Top Contents Index