AcornSearch - Acorn and RISC OS information searching
RISC OS Search
containing
"Nutty quip goes here!"
Home  |  About  |  Filebase Archive  |  StrongHelp Manuals  |  Newsgroups  |  Module Database
Links submenu to menu item

*     R0 =     handle of the menu item or 0 if current menu item
     R1 =     handle of submenu or pointer to submenu or window handle
           if R1 < &8000 then R1 is window handle
           if R1 > &8000 then R1 is pointer to menu 
           if R1 < 0 then R1 is menu handle
*     R0,R1     preserved

Use:     This call is used for constructing multilevel menus. R0 on entry contains the handle of menu item. This item is linked with submenu or dialog box depending on contents of R1. To connect submenu R1 may contain menu handle (as returned by "MenuUtil_New") or absolute pointer to the menu data structure. To connect dialog box R1 must contain window handle of dialog box (as returned by "Wimp_CreateWindow").

Example code...
Example code (MenuUtil_Submenu)
Connect "About this program" window to the item "Info":

  SYS "Wimp_CreateWindow",,block% TO infoWindow%
  SYS "MenuUtil_Submenu",infoItem%,infoWindow%

Create "Display" item in filer menu:

  SYS "MenuUtil_New",,"Filer"
  SYS "MenuUtil_Add",,"Display"
  SYS "MenuUtil_Submenu",,dispMenu%

[sh-index] Back to list of manuals