h6. [[WindowManager]] h6(. » [[WindowManager SWI Calls|SWI Calls]] h6((. » [[Wimp_Poll|Wimp_Poll]] h6(((. » [[Reason Codes|Reason Codes]] h6((((. » Menu_Selection h2. Menu_Selection h5. (Reason Code 9) |_<. Exit | | |<^. Block | | |>^. +0|Item in main menu | |>^. +4|Item in 1<sup>st</sup> sub-menu | |>^. +8|Item in 2<sup>nd</sup> sub-menu | |>^. …|and so on... | |>^. …|...Terminated by -1 value | h4. Use This code is returned from [[Wimp_Poll|Wimp_Poll]] and indicates that an item has been selected from a menu. h4. Notes The values returned in the block indicate the index number of the item chosen in each menu. The first menu item having a value of 0. A value of -1 denotes no further items. If the item selected had further sub-menus, then the application should simply ignore the selection. As the menu does not return information about which menu each item is from, applications must remember which menu it last opened using [[Wimp_CreateMenu|Wimp_CreateMenu]]. The Wimp also provides an easy way of decoding menu selections using [[Wimp_DecodeMenu|Wimp_DecodeMenu]]. Pressing Return inside a writeable menu item also generates this event, however, pressing Return inside a dialog box opened as a menu does not. Any mouse button can be used to select an item, with the Select and Menu buttons having the same effect. Selecting with the Adjust button, however, selects the menu item but should also keep the menu open to allow the user to make more selections. Some assistance from the application is required for this to happen. See [[Wimp_CreateMenu|Wimp_CreateMenu]] for more details. To identify which mouse button was pressed, applications should call [[Wimp_GetPointerInfo|Wimp_GetPointerInfo]]. h4. See also * [[Reason Codes|Reason Codes]] * [[Wimp_CreateMenu|Wimp_CreateMenu]] * [[Wimp_DecodeMenu|Wimp_DecodeMenu]] * [[Wimp_GetPointerInfo|Wimp_GetPointerInfo]] * [[Wimp_Poll|Wimp_Poll]]