Constructing the menu

The cpConstructor tool allows you to visually build elements of the presentation for a program. You then save these elements in an archive associated with your program, and your program retrieves the elements from the archive when it is executed.

If you want to run the version of the Tiles program that uses archives, you need to either:

  1. Build the menu and the archive using the cpConstructor tool.
  2. Convert the Tiles export file into an archive.
    An export file contains a textual representation of the data in an archive (archive files contain binary data), allowing it to be manipulated outside the cpConstructor tool. The directory containing the code for this step,
    $TaligentRoot/TaligentSamples/Supported/Apps/TilesTutorial/05.Menus/Tiles, includes an export file you can use to build an archive if you don't want to construct the menu yourself. See
    "Working with export files" on page 87 for information on how to convert an export file to an archive.
For more information on archives and export files, see the chapter "Working with archives" in cpConstructor GUI Development Tool.

Using the cpConstructor tool

Because the contents of the Tiles archive are already provided in the export file, you don't need to worry about using the cpConstructor tool to construct the menu yourself. However, if you want to experiment with the cpConstructor tool, you can use this as a sample exercise. Understanding how an archive is created will also help you understand how you can write code that works with the archived menu.

To use the cpConstructor tool to construct the Tiles menu, you would:

  1. Start the cpConstructor tool.
  2. Create a new menu object by dragging a menu object from the cpConstructor tool Parts palette into the Category viewer. The Category viewer displays the categories of objects that you are currently building (for example, views, menus, and controls).
  3. Open the Menu editor to edit the new menu object.
  4. Create each new menu item by selecting the Item button.
    For each menu item you create, you need to specify a label, an associated action, and a menu ID number. You can specify this information by opening an Inspector window for the item, as shown:




  1. Archive the new menu. You must give the archive for any program the same name as the library for the program; so, for example, name the archive for the Tiles program TilesTutorialLib. The cpConstructor tool then creates an archive file called TilesTutorialLib.archive.
For complete information on how to use the cpConstructor tool to create menus, see the chapter "Creating a menu" in cpConstructor GUI Development Tool.

Working with export files

The online directory containing the Tiles code for this step,
$TaligentRoot/TaligentSamples/Supported/Apps/TilesTutorial/05.Menus/Tiles, provides the contents of the Tiles archive in an export file called Tiles.export. You can create the Tiles archive from this export file by doing the following:

  1. Start the cpConstructor tool.
  2. Import the file Tiles.export using the Export/Import menu.
  3. Create an archive using the Archive menu.
    Make sure you name the archive TilesTutorialLib--the cpConstructor tool adds the .archive extension. When you execute the Tiles program, this archive needs to be in the same directory as the TilesTutorialLib shared library.

[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker