Adding a menu bar to a window

To have a menu bar display when a window is opened by a user, you associate a menu with the window in the Window painter.

StepsTo associate a menu with a window:

  1. Click the Open button in the PowerBar, select the window with which you want to associate the menu, and open the window.

  2. Do one of the following:

  3. Click Save to associate the selected menu with the window.

Identifying menu items in window scripts

You reference menu items in scripts in windows and controls using the following syntax:

menu.menu_item

You must always fully qualify the menu item with the name of the menu.

When referring to a menu item in a drop-down or cascading menu, you must specify each menu item on the path to the menu item you are referencing, separating the names with periods.

For example, to refer to the Enabled property of menu item m_open, which is under the menu bar item m_file in the menu saved in the library as m_menu, use:

m_menu.m_file.m_open.Enabled

Changing a window's menu during execution

You can use the ChangeMenu function in a script to change the menu associated with a window during execution.