Menu fields in EGL consoleUI

The following list defines the fields in a variable of type Menu. You must specify the field labelText or labelKey.
labelText
The label that is displayed to the left of the list of menuItems.
  • Type: String literal
  • Example: labelText = "Options: ".
  • Default: none.
  • Updatable at run time? No
labelKey
Specifies a key for searching the resource bundle that contains the menu label. If you specify both labelText and labelKey, labelText is used.
  • Type: String
  • Example: labelKey = "myKey"
  • Default: Empty string
  • Updatable at run time? No

The resource bundle is identified by the system variable ConsoleLib.messageResource, as described in messageResource.

menuItems
An array of menu items, each of which is declared in the program or is created dynamically with the keyword new. For details on the second option, see Use of new in consoleUI.
  • Type: MenuItem[]
  • Example: menuItems = [myItem, new MenuItem {name = "Remove", labelText = "Delete all"}].
  • Default: none.
  • Updatable at run time? No
You can add a menuItem in the program by using the following syntax:
  myMenu.MenuItems.addElement(myMenuItem)
myMenu
Name of the variable of type Menu.
myMenuItem
Name of the variable of type MenuItem.

The program ends if you issue an openUIstatement for a menu on which no menuItems exist.

Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.