You can create and attach a menu bar to any floating window. The menu bar is created and maintained with the methods described in Menus Overview. Note that when a floating window is created, its menu, if present, is the only menu available as long as that floating window is the active window. Menus in other windows are disabled.
The library routine W$MENU is used to create and control the menu bar. When you call W$MENU, and the routine has to resolve which window to apply its actions to, it assumes the current window. With the following operations, you can specify a particular window by passing the target window's handle as a parameter in the position noted below.
WMENU-SHOW --3rd parameter WMENU-GET-HANDLE --2nd parameter
If you have a floating window displayed, and you want to update the menu in the main application window, you must specify the handle of the main application window in the call to WMENU-SHOW. For example:
DISPLAY INITIAL WINDOW, HANDLE MAIN-WINDOW PERFORM BUILD-MAIN-MENU CALL "W$MENU" USING WMENU-SHOW, MENU-HANDLE . . DISPLAY FLOATING WINDOW ... . . PERFORM CHANGE-MAIN-MENU CALL "W$MENU" USING WMENU-SHOW, MENU-HANDLE, MAIN-WINDOW