ClassPackage: cgToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.1
Object described on page has changed in 8.1.
8.0 version

static-picture

Class

The class of a static-picture control.

Control

An instance of the :static-picture class. This control displays an icon which may not be changed by the user. It can act like a button; it may be set to receive mouse clicks via the on-click event handler.

The image that is to appear on a static-picture (or on a picture-button) 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):

Mapping application values to multiple pixmaps

The pixmap-alist property of a static-picture may be set to an association list that maps arbitrary application values to pixmaps that represent them. Then whenever the value property of the widget is set to one of those application values, the associated pixmap will be displayed. And if the widget's user-modifiable property is true, then the user will be able to cycle through the pixmaps by clicking the widget or pressing the spacebar when the widget has the keyboard focus; selecting a new pixmap will set the value property of the widget to be the associated application value. See pixmap-alist for the format of the association list.

Further notes

Resizing a static-picture may mean that an aliasing (jaggies) problem appears in the pixmap. Go back to the program that created the graphic and re-save it at a higher resolution or a larger image size if you encounter this problem.

Customizing the static-picture control

The stretching property: if the :stretching option 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.

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

A diagram of window and widget classes is shown in Widget and window classes in cgide.htm.


Copyright (c) 1998-2009, Franz Inc. Oakland, CA., USA. All rights reserved.
Documentation for Allegro CL version 8.1. The object described on this page has been modified in the 8.1 release; see the Release Notes.
Created 2007.4.30.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.1
Object described on page has changed in 8.1.
8.0 version