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
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.
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.
Rather than creating direct instances of
, you usually create instances of its subclasses, each of which has a specific interaction style. Occasionally it may be easier to instantiate
directly with the appropriate value of
(for instance, when the interaction style is only known at run-time) but you may not use such a button as an item in a button-panel.
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:
For buttons this is a synonym of
, 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, including a .ico file on Microsoft Windows. 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 some platforms 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.
CAPI Reference Manual - 15 Dec 2011