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

Specifying Additional Menu Entry Properties

In Chapter 3, Defining a Simple Menu you learned to specify whether a menu entry is initially enabled, and/or initially checked. You also learned to specify the effect of choosing a leaf entry. In this section, you learn to specify additional menu entry properties.

Specifying a Dialog Entry on a Menu Entry Label

A dialog entry is a leaf entry that posts a dialog when chosen. By convention in standard menu systems, the label of a dialog entry is followed by an ellipsis (...).

The G2 5.0 text editor uses an ellipsis to indicate the site of a syntax error. You must therefore specify an ellipsis in a dialog entry label using the G2 escape character, @. For example, if you want a label to read "Save As..." you enter "Save As@.@.@."

The text editor strips escape characters when it closes. If you again edit a label that has an ellipsis, replace the stripped escape characters before you close the editor.

Specifying a Menu Entry Accelerator Label

A menu entry accelerator label is a text string that describes the corresponding accelerator in some way. An accelerator is a keystroke that has the same effect as choosing a menu entry. Typing the keystroke executes the same user-defined procedure that choosing the menu entry executes.

The techniques that bind an accelerator to a user-defined procedure are not part of GMS: they are standard G2 techniques. For an example, see Implementing Keyboard Accelerators.


Note: GMS does not require any menu entry to have an associated accelerator, nor does GMS require a menu entry with an associated accelerator to contain an accelerator label.

To specify an accelerator label in a menu entry:

The accelerator label that you specify will appear to the right of the menu entry label whenever the entry is visible to the user.

Specifying Help Information

Menu entry Help information is a text string that provides information about the entry in addition to that provided by its entry label.

To specify Help information for a menu entry:

The specified information will appear in the Help bar at the bottom of the G2 window whenever the menu entry is selected and GMS is configured to display Help information. You can turn Help information on and off, and control the font in which GMS displays it.

To configure GMS to display Help information you edit the attribute table of the User Preference object for the G2 window in which the help information is displayed. For more information on the User Preference object, see Managing User Preferences.

To set GMS to display Help information:

  1. Set Gms-show-help-message to be true.

    The default setting is false, so Help information is not shown unless the system is specially configured to display it.

  2. Set Gms-priority to be a higher number than that of any of the other preference objects. For more information on setting the priority of user preference objects see Specifying Generic User Preferences.

To specify the font size used to display Help information:

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

Copyright © 1997 Gensym Corporation, Inc.