| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (4 out of 9)

Creating Buttons

To create a button:

where button-type is a type of button. The new button appears on the workspace connected to the mouse. Move the mouse to position the button and click to place the button on the workspace. Here are examples of each type of button:



Tip: You cannot open the attribute table of a button without pausing the KB. If a button's attribute table is visible while the KB is running, however, you can edit its attributes.

Common Attributes of Buttons

Buttons have the following class-specific attributes. Attributes unique to a particular button are explained in the sections describing that button.

Attribute Description
Label
Provides a description of the button.
Allowable values:
Any text string
Default value:
none


Variable-or-parameter
The variable or parameter whose value the button represents. Action buttons do not include this attribute.
Allowable values:
Any variable or parameter
Default value:
none

Providing a Label for the Button

The optional Label attribute provides a textual description for the button, which you enter as a text string within quotation marks (" "). The default is none.

For action buttons, the label appears inside the rectangular boundary of the button. The size of the action button increases to accommodate the length of the label.

The label appears to the right of check boxes and radio buttons and to the left of sliders and type-in boxes.

Use the label to describe a button, or to indicate which value the variable or parameter expects when the button is active.

Representing the Variable or Parameter

The Variable-or-parameter attribute indicates which variable or parameter receives a value when the user clicks on the button. This is a required attribute for check boxes, radio buttons, sliders and type-in boxes, but is not applicable to action buttons. The default is none.

For radio buttons, several buttons represent different values for one variable or parameter. For check boxes, each box represents a separate variable or parameter.

Buttons associated with a variable or a parameter always attempt to update whenever their variables or parameters receive values from other sources. For example, if a check box is set to on, and a rule sets the variable or parameter to its off value, G2 sets the check box to off. Similarly, if two check boxes exist for the same variable, turning off one turns off the other, unless the check boxes have different on or off values.

| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (4 out of 9)

Copyright © 1997 Gensym Corporation, Inc.