Generic Function | Package: cg | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 9.0 Unrevised from 8.2 to 9.0. 8.2 version

## handle-menu-selection

Arguments: menu menu-item-or-item-number window-or-screen

Called to process a menu-item that was chosen by the end user (either by clicking on it or first selecting it and then pressing the main Enter key).

The default method first checks to see if the value of the chosen menu-item is another menu. If so, it calls pop-up-menu on that menu. Otherwise it funcall's the value of the on-click property of the menu, passing three arguments:

1. the menu that was passed to this function
2. the chosen menu-item
3. the stream that was passed to this function, which is either a window or the screen

menu is the menu that contains the chosen menu-item.

menu-item-or-item-number is either the menu-item that was chosen, or the index of the item within the menu-items of the menu, where zero indicates the topmost menu-item.

window-or-screen is either the window on which the menu was invoked with pop-up-menu, or else the window on which the menu was defined or the screen.

The default handle-menu-selection method should suffice for most applications, since menus are typically customized by a combination of menu-item values and (when needed) custom on-click event handlers.

But an application could replace the default handle-menu-selection method with one that bypasses the on-click functionality entirely. Or an application could add handle-menu-selection wrapper methods that catch every menu choice for some class of menu.

See cg-events.htm for information about event handling in Common Graphics.

Copyright (c) 1998-2019, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 8.2 page.
Created 2012.5.30.

|  | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 9.0 Unrevised from 8.2 to 9.0. 8.2 version