picture-button

Class

Package: common-graphics

Class

The class of a picture-button control

Control

Instance of the picture-button class. This control contains an icon that may be selected by the user. It is capable of a non-momentary pressed-in state.

The image that is to appear on a picture-button (or on a static-picture) widget may be specified with any one of the following properties (typically by passing the equivalent keyword argument such as :pixmap to make-instance when creating an instance of the widget):

Further notes

If the :stretching option to make-instance is passed as non-nil, then the bitmapped image will stretch automatically to fit the size of the widget. If nil, it will be drawn at the size at which the image was defined. The default is t. See stretching.

Grouping picture-buttons in clusters

The :cluster entry on the dialog item plist can be used to group picture-button dialog items into clusters. If the user clicks on one button in the cluster, that button will be turned on, and all other buttons in the cluster turned off. For example, consider the following:

(make-instance 'picture-button ... :cluster 'cluster1) 
(make-instance 'picture-button ... :cluster 'cluster1) 
(make-instance 'picture-button ... :cluster 'cluster2) 
(make-instance 'picture-button ... :cluster 'cluster2)

It creates two picture-button clusters each with two picture buttons. :cluster entries are compared using eql.

Component overhead and clusters of picture-buttons

Using a multi-picture-button instead of clusters of picture-buttons will reduce the load on resources and reduce application size/complexity in most situations. Components are window-like objects and are relatively costly in terms of system resources.

Using click-off with picture-button controls

This control supports the click-off property. The :click-off option to make-instance can have the following values:

:yes: Users will be able to deselect the button by clicking on it when currently selected. This is the initial value for picture-buttons.

:no: Users can only deselect a selected button by selecting another button in the same cluster.

Nil: The default value for the specific class of control.

Note: this option affects only what happens when clicking on a button widget while it is selected; the state of the button can always be changed programmatically by calling (setf value).

See About how to get sample code for creating controls in cgide.htm, which explains how to use the IDE to create such code.

Common Graphics and IDE documentation is described in About Common Graphics and IDE documentation in cgide.htm.

The documentation is described in introduction.htm and the index is in index.htm.

Copyright (c) 1998-2000, Franz Inc. Berkeley, CA., USA. All rights reserved.

Created 2000.10.5.