Member variable XbpToolBarButton():key Foundation

Specifies a key string that uniquely identifies a tool bar button.

Attribute: EXPORTED
Data type: Character ("")
Description

The :key instance variable contains a character string that can be used to uniquely identify a button object within its XbpToolBar container. While the ordinal position of a tool bar may change as buttons are added or deleted at run time, a button's key string must be unique over the lifetime of the toolbar object. If an attempt is made to add a button with a duplicate key string, or if the key of an existing button is to be set to a duplicate value, a runtime value is generated.

The key string assigned to a given tool bar button can be specified using the <cKey> parameter to XbpToolBar:addItem(). Alternatively, a button's :key instance variable may be used to change its key string after it has already been added to an XbpToolBar instance.

Using key strings versus ordinal item positions can greately enhance source code maintenance and readability.

// An example for using :key to distinguish between 
// individual buttons defined in an XbpToolBar 
// instance can be found under method :loadImageSet() 

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.