The interaction style for the button.
For radio button and check button styles, if
is set to
, the button is initially selected.
Specifies the callback to use when the button is selected.
An image for the button (or
the button cannot be selected.
If true the button is the "Cancel" button, that is, the button selected by the Escape key.
If true the button is the default button, that is, the button selected by the
The image used when the button is pressed and
A character, integer or symbol specifying a mnemonic for the button.
The abstract class
is the class that push-button, radio-button, and check-button are built on. It can be displayed either with text or an image, and a callback is called when the button is clicked. It inherits all of its textual behavior from item, including the slot
which is the text that appears in the button.
The subclasses of
are just buttons with different interaction styles. It can often be easier just to make an instance of
with the correct value of
(for instance, when the interaction style is only known at run-time). The values allowed for
are as follows:
A push button.
The button's callback gets called when the user clicks on the button, and by default gets passed the data in the button and the interface. This can be changed by specifying a callback type as described in the description of callbacks. The following callbacks are accepted by buttons:
Called when the button is pressed.
, meaning that the button is a text button, but if
is provided then the button displays an image instead of the text. The image can be an external-image or any object accepted by load-image. The disabled image is the image that is shown when the button is disabled (or
, meaning that it is left for the window system to decide how to display the image as disabled). On MS Windows, the system computes the disabled image and so
The button's actions can be enabled and disabled with the
slot, and its associated accessor
. This means that when the button is disabled, pressing on it does not call any callbacks or change its selection.
Note that the class button-panel provides functionality to group buttons together, and should normally be used in preference to creating individual buttons yourself. For instance, a radio-button-panel makes a number of radio buttons and also controls them such that only one button is ever selected at a time.
A mnemonic is an underlined character within the button text or the printed representation of the button data which can be entered to select the button. The value mnemonic is interpreted as described for menu.
An alternative way to specify a mnemonic is to pass mnemonic-text . This is a string which provides the text for the button and also specifies the mnemonic character. mnemonic-text and mnemonic-escape are interpreted in just the same way as the mnemonic-title and mnemonic-escape of menu.