This figure shows an action button that has two attribute displays: the
Label attribute and the Notes attribute, which is showing the attribute name as well as the value:
![]() |
The attribute displays of an item are part of its knowledge. As you move an item within its workspace, its attribute displays move with it. When you transfer an item to another workspace, its displays are transferred with it. G2 saves knowledge about an item's attribute displays in the KB file.
Attribute displays can only show the value for an attribute that does not contain an item. For example, you cannot display the attributes of a quantitative variable that provides the value of a tank's
Pressure attribute.
Note: An item's name box is not the same as an attribute display of the item's Names attribute.
To create an attribute display for an attribute in a table interactively:
Click on the row for any attribute, and select the show attribute display menu choice.
The text shown in an attribute display appears in the color assigned to the
foreground-color color attribute of the item's parent workspace.
Note: You cannot create attribute displays for charts, connections, digital clocks, freeform tables, graphs, or readout tables.
Graphs are a superseded capability. For more information see Appendix F, Superseded Practices.
Unlike readout tables, attribute displays do not cause data-seeking. If an attribute's value changes and its value is shown in an attribute display, the display is updated with the new value. In addition, attribute displays are always updated to reflect the current values of the attributes displayed, and cannot be disabled.
Note: If you change the name of an attribute whose value appears in an attribute display, G2 removes the attribute display.
Adding Attribute Displays to Class Definitions
You can also define attribute displays in class definitions so that each instance of the class automatically contains an attribute display.
To define attribute displays for instances of a user-defined class:
Add a declaration in the Attribute-displays attribute of the class definition.
Attribute-displays attribute of a class definition is described in Specifying Attribute Displays.
Manipulating an Attribute Display From its Menu
You can manipulate an attribute display by opening its menu:
![]() |
Note: If you click too close to the attribute display value, G2 invokes the Text Editor rather than the attribute display menu.
To add or delete the name of the displayed attribute in the attribute display:
Select the add name of attribute or delete name of attribute menu choice.
To delete an attribute display:
Select the hide attribute display menu choice.
To display another attribute value in an existing attribute display:
Select the add another attribute menu choice, then select another attribute whose value you want to show within the same display.
G2 lists the attributes in the order that they appear on the item's attribute table, regardless of what order you use when creating the displays.
To refer to the attribute displays of all items, except class definitions:
the current-attribute-displays of item-> display-details: sequence
To refer to the attribute displays that a class definition defines:
the attribute-displays of class-definition-> display-details: sequence
current-attribute-displays of an item. As an example, the next figure illustrates the current-attribute-displays sequence of a variable
auto-count, which has attribute displays for its Notes and Last-recorded-value attributes.
![]() |
Example: Adding Attribute Displays to New Objects
In the next example, a whenever rule tracks the creation of instances of hatchback automobile objects, starting the add-displays procedure each time G2 detects a new instance:
![]() |
To add attribute displays to an item:
auto-count, concludes that value to an attribute of the new hatchback object, and then displays the value and name of that attribute by setting the subattribute display-with-name to true.
![]() |
Notice that the procedure specifies the position of the attribute display with:
the symbolAT-STANDARD-POSITION
![]() |