Creating menus

What makes menus work

You create menu files with a text editor and save the file with an .SRC extension. Then you use the MENUMAKE program to compile the file. It is given a .DAT extension and, as a compiled file, is no longer editable. Any edits must be made to the .SRC file and then the .SRC file must be recompiled.

Elements of a menu

There are three primary elements to every menu: MENU, ITEM, and EXEC. As these elements are expanded and repeated, controlled options are displayed within each window.

The following display shows the .SRC file used to create a menu. This file shows how these three elements are used. Details about these elements and their options are covered in ``Using the NMENU commands''.

   Menu 1, Title Bar
      Item One {pause}
         Exec dir
      Item Two {show pause}
         Exec ver
      Item ^XExit
         Exec EXIT

Combining the menu elements

``A multiple-window menu'' illustrates a menu with 10 windows, created by including 10 MENU commands in the same file. Each window is automatically sized and cascaded across the screen.

A multiple-window menu

Menu creation steps

There are generally six steps to follow when considering a new menu. The relationship among steps is shown in ``Charting the steps in creating a menu''.

Charting the steps in creating a menu

Each step in the flowchart is explained next.

  1. Plan and design your menu. Before starting, answer the following questions:

  2. Use a text editor to create your menu file with an .SRC extension.

  3. Compile the .SRC file with the MENUMAKE program. This will create a .DAT version of the file.

    The results of any errors occurring during the compile process, including detailed error messages per line of script, are displayed on your screen. Fix the errors in the .SRC version of the file according to the error messages, and then recompile.

    When you have eliminated all the errors, continue with Step 4.

  4. Run NMENU filename.dat to verify that it does what you expect.

  5. Change the program if needed, as described in Step 3, and then repeat Step 4. When Step 4 is successful, go on to Step 6.

  6. Provide access to the intended users by placing the .DAT file in an appropriate directory and granting sufficient rights to the users.

    Information on placement of files and required rights is in ``Making menus work''.

Following these six steps can help you learn how to use the scripting language and how to manage the menu files you create.

Use of the NMENU program is almost unlimited. When considering the uses for menus, remember that they can be as simple as presenting available application programs (see ``Example of a simple menu'').

Example of a simple menu

Menus also can be more complex, such as guiding data entry for cataloging (see ``Example of a more complex menu'').

Example of a more complex menu

The text used to create the four menus discussed in this topic is included in ``Creating a menu file''.

Before you look at how these menus were created, however, you should be familiar with the guidelines for planning menus and also with the scripting language rules.


© 1999 The Santa Cruz Operation, Inc. All rights reserved.
UnixWare 7 Release 7.1.1 - 5 November 1999