Member variable XbpToolBarButtonMenuItem():key Foundation

Specifies a key string that uniquely indentifies a menu item.

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

The :key instance variable contains a character string that can be used to uniquely identify a menu item within the associated drop-down menu. While the ordinal position of a menu item may change as buttons are added or deleted at run time, an item's key string must be unique over the lifetime of the toolbar object. If an attempt is made to add an item 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 drop-down menu item can be specified using the <cKey> parameter to XbpToolBarButton:addItem(). Alternatively, a menu item's :key instance variable may be used to change its key string after it has already been added to the drop-down menu of an XbpToolBarButton instance.

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

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.