| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (3 out of 6)

Compiling and Building Menus

When you reset G2, GMS always invalidates all window handles and deletes all menu instances. Unless Gms-keep-compiled-resource is true in the current Global Settings object, GMS also deletes the compiled resource, if any.

When you start G2, and Gms-initiate-automatically is true in the current Global Settings object, GMS does the following.

  1. If no compiled resource exists, compile all menus as specified by the attributes of the current Global Settings object.

  2. Assign a handle to every G2 window.

  3. Build an instance of every menu in the compiled resource for every G2 window.

  4. For every user whose current User Preferences object so specifies, display an initial menu bar in the user's G2 window.

When Gms-initiate-automatically is false, and you start G2, GMS does nothing. The actions listed then occur only in response to explicit GMS API calls and/or choices in the G2 menus of GMS objects. The rest of this section describes those calls and choices, and their various effects.

Compiling Menus

You can use G2 menu choices and/or GMS API calls to compile any or all menu specifications. The API call to compile menus is:

	gms-compile 
(specs: item-or-value, window: class g2-window, build?: truth-value)
You can also compile one or all menu specifications by choosing commands from a root template's G2 menu.

To compile a single menu specification:

or:

To compile several menu specifications:

  1. Create an item list that contains the specifications to be compiled.

  2. Call gms-compile giving the item list as the value of specs.

To compile all menu specifications:

or:

Building Menus

If you call gms-compile giving build? the value true, GMS automatically builds menus for the window designated by window after compilation is complete. You can also ask for menu building explicitly.

To build menus for a window:

To delete all menu instances for a window:

| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (3 out of 6)

Copyright © 1997 Gensym Corporation, Inc.